Call SQL database from a distant server (iphone)
Hey,
I'm looking to call a database from a distant server (the database is not in the app directory but on the web), you know with php you use some function like mysql_connect
Thanks
3 Answers
-
try this, http://php.net/manual/en/book.mysql.php
-
You'd need a MySQL driver for the phone - which might be a problem.
Most people wrap the database in a REST based web service. -
The best way to do that is call a php file on your webserver with
Titanium.Network.HTTPClient
which handles all of the SQL calls then just return the result as a JSON object and load that in to your script with the 'xhr.onload' function of theTitanium.Network.HTTPClient