Hello,
My apps has been running fine more than 1 year. The connection from the apps is made to the mysql in remote server based on the tutorial by Erer here
However since this morning we have problem getting the reply from the server whenever we sent the mysql query (as per attached file)
After some googling, I am convinced that the solution is to add "Content Length in HTPP header".
The problem is, based on the Erel tutorial, how do I add this into the "countries.php" file? or where exactly do I add this?
Thank you for your responce.
My apps has been running fine more than 1 year. The connection from the apps is made to the mysql in remote server based on the tutorial by Erer here
However since this morning we have problem getting the reply from the server whenever we sent the mysql query (as per attached file)
After some googling, I am convinced that the solution is to add "Content Length in HTPP header".
The problem is, based on the Erel tutorial, how do I add this into the "countries.php" file? or where exactly do I add this?
Connect To MySql:
<?php
$databasehost = "localhost";
$databasename = "xxxx";
$databaseusername ="xxxx";
$databasepassword = "xxxx";
$con = mysqli_connect($databasehost,$databaseusername,$databasepassword, $databasename) or die(mysqli_error($con));
mysqli_set_charset ($con , "utf8");
$query = file_get_contents("php://input");
$sth = mysqli_query($con, $query);
if (mysqli_errno($con)) {
header("HTTP/1.1 500 Internal Server Error");
echo $query.'\n';
echo mysqli_error($con);
}
else
{
$rows = array();
while($r = mysqli_fetch_assoc($sth)) {
$rows[] = $r;
}
$res = json_encode($rows);
echo $res;
mysqli_free_result($sth);
}
mysqli_close($con);
?>
Thank you for your responce.