Jquery Get Request Won't Get Correct Data From Php Echo
I am trying to fill a table using a jquery .get request, the url being a php file. The php gets data from a database, then it should return a json array back to the jquery, array w
Solution 1:
If you look at your JSON data, you can see that there are no keys such as teams
or playedgames
. This is because you used fetch_row()
in the PHP. Change that to fetch_assoc()
:
while ($row = $result->fetch_assoc())
This will give you $row
with the field names as keys instead of using numerical keys that fetch_row()
provides.
Post a Comment for "Jquery Get Request Won't Get Correct Data From Php Echo"