hi
i am using in one of my apps queries that i send to a PHP file and return a JSON string.
the problem is that the string that is returned contains 2 chars at the start that are creating an error.
if i put the copied string to the online JSON Parser tool i get an error:
going to the first char and pressing 2 times then the "Delete" button fixes that issue. the thing is that nothing is really deleted so those chars are not letters or numbers. how can i fix that issue?
what i do now is this:
this works but i wonder why is that happening?
PHP:
thanx
i am using in one of my apps queries that i send to a PHP file and return a JSON string.
the problem is that the string that is returned contains 2 chars at the start that are creating an error.
if i put the copied string to the online JSON Parser tool i get an error:
going to the first char and pressing 2 times then the "Delete" button fixes that issue. the thing is that nothing is really deleted so those chars are not letters or numbers. how can i fix that issue?
what i do now is this:
B4X:
Dim jsonStr As String = j.GetString
Dim parser As JSONParser
parser.Initialize(jsonStr.SubString2(jsonStr.IndexOf("["),jsonStr.Length))
this works but i wonder why is that happening?
PHP:
PHP:
case "getbyemail":
$table = $_GET["mytable"];
$email = $_GET["email"];
$q = mysqli_query($con, "SELECT * FROM $table WHERE email = '$email'");
$rows = array();
while($r = mysqli_fetch_assoc($q))
{
$rows[] = $r;
}
echo json_encode($rows);
mysqli_free_result($q);
break;
thanx