I am trying to connect to MySQL using PHP from an Android Device. I am following this tutorial: http://blog.sptechnolab.com/2011/02/10/android/android-connecting-to-mysql-using-php/
My question is where does the php file go that you create? Is that included in your Android Project or where do i run it from?
Thanks
解决方案
To answer your questions:
1) The php file is not included on the Android device.
2) You need to create the .php file and upload it to a server.
Now, I'm not sure how much you know about php, but just in case you are a beginner, you can easily create .php files using a text editor application such as Text Edit (Mac) or Notepad (Windows). Do you control a server or have a website somewhere? If so, you can upload the file to a location there.
How the php file will work:
First, your android device (once your finish that tutorial you cited) will send a request to the php file on your server, and the php file will then connect to the MySQL database, and generate some output which your Android app can get back (ex. to know the result of the MySQL connection attempt, etc)
*Going Further
If you want a super-easy tutorial on php check out W3 Schools excellent php section: http://www.w3schools.com/php/