Hi all.
Until today i have used the db.php file as an example of Erel ( Connect Android to MySQL ) , and it always worked.
Now i have a server that for safety reasons have disabled the use of file_get_contents. I tried using CURL, but without success.
Any suggestions ??
Thank you
Marco
Until today i have used the db.php file as an example of Erel ( Connect Android to MySQL ) , and it always worked.
Now i have a server that for safety reasons have disabled the use of file_get_contents. I tried using CURL, but without success.
B4X:
<?
$hst = "localhost";
$db = "xxxx";
$usr = "xxxxx";
$pwd = "xxxxx";
$conn_DB=mysql_connect($hst,$usr,$pwd) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET NAMES 'utf8'");
mysql_query("SET COLLATION_CONNECTION = 'utf8_unicode_ci'");
$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, 'php://input');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$query = curl_exec($ch);
curl_close($ch);
// display file
echo $query;
//$query = file_get_contents("php://input");
$sth = mysql_query($query);
...
Any suggestions ??
Thank you
Marco
Last edited: