mysql_connect($hostname,$username, $password) OR DIE ('Unable to connect to database! Please try again later.'); mysql_select_db($dbname);
Last year, during my High School Computer Science coursework, I was relatively certain that I stumbled upon a jQuery library that allowed you to run SQL queries to locally hosted databases; I'm not sure of the legitimacy of this library as it didn't (and doesn't) seem very do-able.You can use DroidScript to craft a URL request to a PHP file on your server, which handles your MySql query there, and have remote PHP send back a JSON response to DroidScript.
Even use PHP locally on device to do things for DroidScript that DroidScript might never have enough demand to be be set up to do itself.
One local phone pure php server is available - Last updated 2015-10-18 to PHP 5.6.12
There are built in MySql and MySqli extensions.
You can download that app here:
https://play.google.com/store/apps/details?id=com.esminis.server.php
Author
(and a full list of available extensions etc):
https://bitbucket.org/esminis/server.php
Tautvydas Andrikys http://esminis.com
License:
Source code is licensed under the Apache License, Version 2.0