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?

  $ data = mysql_fetch_assoc ($ r); }} Header ('Content-Type: App / Jason'); $ Output = array ("check" => gt; check, "user" = & gt; $ data, "testnumberoffrows" => $ number); Echo json_encode ($ output);   

AjaxFunction

  if (data.check) {var user = data.users; Console.log (user);   

Thanks, Richard

mysql_fetch_assoc () < / Code> only a fetches the line until it FALSE creates an output array, you need a loop.

Something like this:

  while (($ row = mysql_fetch_assoc) ($ R)) == FALSE {$ data [] = $ line; }    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -