Also, as a bit of extra information, I would sometimes like to output mysql results as json for ajax applications (although there is a MUCH better way of doing it, and I no longer use the mysql side of this function, for someone just starting out with json this could be helpful). In which case, you cannot just pass a mysql query to json_encode(). Here is the function that I used:
Main Topics
Browse All Topics





by: LordZardeckPosted on 2009-10-30 at 08:52:57ID: 25704166
Its very easy, all you do is match your array associations.
Now, someone correct me if the following code is wrong. I haven't tested it, but it should be what you want.
Select allOpen in new window