When I view this (the end of a method) on a browser I see the printout of the JSON echo.
JSON echo
[{"0":"2222","id":"2222","1":"john","first":"john","2":"true","last":"true"},{"0":"35","id":"35","1":"Griffin","first":"Griffin","2":"Peter","last":"Peter"},{"0":"40","id":"40","1":"cameron","first":"cameron","2":"Peter","last":"Peter"},{"0":"22","id":"22","1":"Sqgger","first":"Sqgger","2":"Peter","last":"Peter"},{"0":"900","id":"900","1":"sayo","first":"sayo","2":"nara","last":"nara"},{"0":"9000","id":"9000","1":"sayaaao","first":"sayaaao","2":"nara","last":"nara"},{"0":"9001","id":"9001","1":"sayaaao","first":"sayaaao","2":"nara","last":"nara"}]
//Perform query
$result = mysqli_query($con,"SELECT * FROM User");
$myJson=array();
//Parse to array
while($row = mysqli_fetch_array($result)){
$myJson[]=$row;
//echo $row['first'] . " " . $row['last'];
//echo "<br />";
}
//Close connection
mysqli_close($con);
//Encode and send response
echo json_encode($myJson);
But on my iOS app, the data is null when I put it in NSLog (but I see the bytes, but the array shows as 0x0000
NSArray* data=[NSJSONSerialization JSONObjectWithData:webData options:0 error:&error];
NSLog(@"name = %@",[data objectAtIndex:0]);//Null
Any thoughts? thanks