Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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.
Posted

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[^]
 
Share this answer
 
v3
Comments
MJR4PJCT 17-Mar-14 23:40pm    
Thank you for your quick reply. I have already implemented this but I wanted to know that how can I shoe the msg from my textmsg column whose record got matched. code for that much part only.
Peter Leow 18-Mar-14 0:22am    
We do not supply code here. You will find the answer if you go through the tutorial. The general idea is like this:
1. Send your inputs, i.e. Place, Reserved,... in json format to the web service.
2. The web service will query the database to retrieve the msg that matches your inputs.
3. The web service will pass this msg in json format to your android app which will display in any way you like, be it toast or what.
Learn to do it yourself. Good luck.
MJR4PJCT 18-Mar-14 1:24am    
Thank you for your reply but I was not using JSON in my application. I had done it before without JSON and it worked and hence trying the same trick for this too.
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[^]
 
Share this answer
 
Comments
MJR4PJCT 18-Mar-14 1:23am    
Thank you for your reply. Can you suggest anything for my this query too ? Here is the link http://www.codeproject.com/Questions/745495/How-do-I-send-sms-like-those-are-sent-after-a-mone [^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900