Reputation: 4875
I'm outputting my DB result like this:
foreach($result as $row) {
echo json_encode($row);
}
This outputs the following:
{"nummer":"600","name":"Location Name 600"}{"nummer":"698","name":"Location Name 698"}{"nummer":"1110","name":"Location Name 1110"}
Is this the right way? Do I have to seperate the result rows from each other?
Edit: If I get a callback id from jquery, what way would I format this into jsonp? To be more specific, I'd like to put an value containing the total amount of results, and then all results found, in jsonp (jquery sends me the id for a callback, which I'll have to put into the output).
Upvotes: 2
Views: 944