Saturday 15 September 2012

Connect android app to an External MySQL database using PHP -


I have created a login_activity for my Android app. How to get the data of an external MySQL database but some tutorial medium I have access to this external MySQL database. I have followed one of the following PHP codes to get my data from the server for my login_activity:

  & Lt ;? Php error_reporting (E_ALL ^ ​​E_NOTICE ^ E_WARNING); $ Dbhost = "Local Host"; $ Dbuser = ""; $ Dbpass = "$ $ connect = mysql_connect ($ dbhost, $ dbsuer, $ dbpass) or die (" database selection error "); $ User name = $ _ post ['username']; $ Password = $ _ post ['password']; $ Query = mysql_query ("select = FROM app_users_parent where email = '$ user name' and password = '$ password'); $ num = mysql_num_rows ($ query); if ($ num == 1) {while ($ list = Mysql_fetch_assoc ($ query)) {$ output = $ list; echo json_encode ('$ output')}} mysql_close ();}? & Gt;   

I understand that The place to get a php file on the same server. But how do I really not understand it? Should I use something like FileZilla for FTP or what? I can not find any tutorials on the net It tells you how and how to save this php file. If you need my Java code, where I am connected to this file, then I can give it to you. (PS- I just have to do with Android , So actually there was no supporter, please respect him)

Tutorials are definitely Good luck to you.

No comments:

Post a Comment