I am developing an application that will involve interaction with a MySQL database whereby the posted data is handled using PHP.
From an Android app, i send HttpRequests to a PHP file [at localhost], which creates a connection to a MySQL dat开发者_JS百科abase and drops some data in a table.
The problem that I am having is that I have installed XAMPP [Apache server, MySQL] but when I start the Apache service, and start the Android application it doesn't fetch any data.
What are the best requirements that will help me get out of this mess so that I may connect my Android app to a MySQL database then do some scripting using PHP?
I have just do the same thing. You should upload your database and php script to a shared host. There are alot of free hosting out there. www.byethost.com www.oni.cc
for example. Have fun. PS: If you dont want to use a shared host, so make sure that your device is connected to your computer's private network. The easy way is use wifi in the same subnet as the server. Otherwise, your device is just dont know where is "localhost" because it's not public.
精彩评论