I have the following json response from a php file
{
"id":"85",
"title":"Hello,
hello I said",
"tags":null,
}
the correct output in the "title" should be: "title":"Hello, hello I said", bla bla bla.
Notice that the comma after the Hello.
i am using json_encode() but I still get the above result (which breaks the json).
here is my php code:
$query = mysql_query("SELECT * from songs");
$rows = array();
while($r = mysql_fetch_assoc($query)) {
$rows[] = $r;
}
$songArray = array(
"songs" => $rows
);
$jsonD = json_encode($songArray);
If I don't include the commas in my input everything works fine.
The code should work, there is nothing special in it.
Does anyone have any ideas why this is happening? How can I be fixed. thank you