I want to ask about the JSON format. The results of Sql is
Year SumOfYear
2011 0.30
2012 0.19
update
this is the part of php code.
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
$results[] = array(
'"Year"' => $row['Year'],
'"SumOfYear"' => $row['SumOfYear'],
);
}
echo json_encode($results);
The results is
[
{
Year: "2011",
SumOfYear: "0.30"
},
{
Year: "2012",
SumOfYear: "0.19"
}
]
if i want to have like below, is it still good format?
{
2011,
2012
},
{
0.30,
0.19
}