Hello again,
Finally, I have decided to by a hosting and a domain (not free) to avoid possible errors, but my app doesn’t work again.
Certainly, the error has changed, but I can not to resolve it.
I have changed all the parameters in the app and .php file. Attachment it. Please help.
This is my .php file:
<?php
$databasehost = "localhost";
$databasename = "test1";
$databaseusername ="user1";
$databasepassword = "pwduser1";
$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);
?>