hi how can i return a echo 'noresult' in this code?
i m runing this query
this user dont exist in my db and the php return nothing on result
Response: []
ok
but now how can i returne one error when dont have result on php ?
Response: erro < example
B4X:
<?
$databasehost = "localhost";
$databasename = "teste";
$databaseusername ="root";
$databasepassword = "";
$con = mysql_connect($databasehost,$databaseusername,$databasepassword) or die(mysql_error());
mysql_select_db($databasename) or die(mysql_error());
mysql_query("SET CHARACTER SET utf8");
$query = file_get_contents("php://input");
$sth = mysql_query($query);
if (mysql_errno()) {
header("HTTP/1.1 500 Internal Server Error");
echo $query.'\n';
echo mysql_error();
}
else
{
$rows = array();
while($r = mysql_fetch_assoc($sth)) {
$rows[] = $r;
}
print json_encode($rows);
}
?>
i m runing this query
B4X:
Sub confereusuarioface
ProgressDialogShow("Carregando...")
ExecuteRemoteQuery("SELECT NickName,StatConta FROM usuarios Where SocID='" &idfacebook& "' and SocNet='" &fa& "' " , verificausuarioface)
End Sub
this user dont exist in my db and the php return nothing on result
Response: []
ok
but now how can i returne one error when dont have result on php ?
Response: erro < example