php - json not giving back the proper result from database array -
I am returning two lines from my query, I tested it in phpadmin.
In the firebug, I can only view data from one row.
Do not I know what can be wrong? AjaxFunction Thanks, Richard Something like this:
$ data = mysql_fetch_assoc ($ r); }} Header ('Content-Type: App / Jason'); $ Output = array ("check" => gt; check, "user" = & gt; $ data, "testnumberoffrows" => $ number); Echo json_encode ($ output);
if (data.check) {var user = data.users; Console.log (user);
mysql_fetch_assoc () < / Code> only a fetches the line until it
FALSE creates an output array, you need a loop.
while (($ row = mysql_fetch_assoc) ($ R)) == FALSE {$ data [] = $ line; }
Comments
Post a Comment