what do i want to do?
I retrieve this data from the server this way : [{"password":"ok"}]
I would like to see only ok , not [{"password":" "}]
I retrieve this data from the server this way : [{"password":"ok"}]
I would like to see only ok , not [{"password":" "}]
B4X:
Sub JobDone (Job As HttpJob)
If Job.Success Then
res = Job.GetString
Log("Back from Job:" & Job.JobName )
Log("Response from server: " & res)
Select Job.JobName
Case "controllo"
Label1.Text=res
Log(Job.GetString)
End Select
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
Dim parser As JSONParser
parser.Initialize(res)
End Sub
PHP:
$action = $_GET["action"];
switch ($action)
{
case 'controllo':
$q=mysql_query("SELECT password FROM tbl_member");
$rows = array();
while($r = mysql_fetch_assoc($q))
{
$rows[] = $r;
}
print json_encode($rows);
break;
}