This is the output:
[
{
"0": "1",
"cat_id": "1",
"1": "Hello World!",
"post_title": "Hello World!",
"2": "1296943703",
"post_date": "1296943703",
"3": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
"post_content": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
}
]
As you may see there are repeated records added to an integer, and the row name, this is how it works:
// SQL statement and mysql_query
$posts = array();
while($row = mysql_fetch_array($result))
{
$posts[] = $row;
}
mysql_free_result($result);
die(json_encode($posts));
How do you get it to not repeat twice, just show the row name and the record.