如何显示其记录与用户输入的凭据匹配的列的字符串? [英] How to show a string from column whose record matched with the credentials a user has entered ?

查看:70
本文介绍了如何显示其记录与用户输入的凭据匹配的列的字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的服务器上有一个数据库,其中有一个名为accounts的表。这个表有4列,分别是Place(varchar),Reserved(int),Mobile no(int),textmsg(varchar)。

现在一旦用户输入地点,保留和移动没有通过我的在android应用程序中的活动,它将转到我的server..check与此表。如果所有三个字段都与特定记录匹配,那么我想显示存储在我的第4列中的消息,即textmsg作为用户的祝酒词。任何人都可以为此指定代码。任何建议或建议将受到高度赞赏。谢谢大家。

I have a database on my server in which I have a table named as accounts. This table has 4 columns namely Place (varchar), Reserved (int), Mobile no (int), textmsg (varchar).
Now as soon as the user enters place, reserved and mobile no through my activity in the android application it will go to my server..check with this table. If all three fields match to a particular record then I want to display the the message stored in my 4th column i.e. textmsg as a toast to the user. Can anyone please specify code for this. Any suggestion or advice will be highly appreciated. Thank you all.

推荐答案

典型的设置是这样的,你的Android应用程序必须与服务器上的某些Web服务进行通信,而服务器又与mysql进行通信任何数据库操作。

建议你先完成本教程,然后你可以调整它以满足你的项目需求:

how-to-connect-android-with-php-mysql [ ^ ]
The typical setup is like this, your android app will have to communicate with some web services on a server which in turn communicates with the mysql for any database operations.
Suggest you go through this tutorial first, then you can adapt it to meet your project needs:
how-to-connect-android-with-php-mysql[^]


这真的很简单。我可以看到你可以与你的数据库进行通信,你可以轻松地检查来自活动和数据库的数据,遍历所有记录,如果你找到了完全匹配,那就吐了吧......

简单,呵呵! :)



AndroidHive [ ^ ]
It's really very simple. As I can see you can communicate with your database, you can easily put a check between data from the activity and the database, iterate through all the records and the if you find the exact match, Toast it...
Simple, huh !! :)

See the similar kind of example over here on AndroidHive[^]


这篇关于如何显示其记录与用户输入的凭据匹配的列的字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆