hi, im currently using:
$rs = mysql_query("SELECT * FROM users");
while($obj = mysql_fetch_object($rs)) {
$arr[] = $obj;
to return an array of objects to an iOS app. Each item in the array is actually a dictionary entry, actually here is the echo of that array:
[
{"id":"1","name":"Marcio Valenzuela","pass":"","udid":"269d4008ba6575b9ec51a7f3237e757c2bcd6bf6","timestamp":"0000-00-00 00:00:00","reglocation":""},
{"id":"2","name":"santi","pass":"","udid":"2031aafb778b3a27635ae38e4315f31bba956805","timestamp":"0000-00-00 00:00:00","reglocation":""},
{"id":"4","name":"xcodesimulator","pass":"","udid":"F6869FB4-2EBE-5D43-A62D-5D4007646764","timestamp":"2010-09-18 11:15:16","reglocation":""},
{"id":"5","name":"abusipad","pass":"","udid":"adf03902c18974c9d29edf27da779afa66438a3b","timestamp":"2010-09-18 11:18:52","reglocation":""}
]
It turns out i actually need that data as a dictionary because i need to pass both the name and userid to the next view controller. Is there an equivalent:
$rs = mysql_query("SELECT * FROM users");
while($obj = mysql_fetch_object($rs)) {
$dic[] = $obj;