I would like to create graph by PHPGraphlib using my data from database.
My problem is, that I have array in different format and PHPGraphlib doesn't read it.
PHPGraphlib reads array like this:
$data = array("15:01:14" => .0032, "15:05:14" => .0028, "15:10:14" => .0021, "15:15:14" => .0033,
"15:20:14" => .0034);
and I create my array:
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$orders[] = array(
'price' => $row['price'],
'clock' => $row['clock'],
);
}
echo json_encode($orders);
so it looks like this:
[{"price":"1570","clock":"14:56:02"},{"price":"1570","clock":"15:01:14"},{"price":"1571","clock":"15:11:49"}]
How can I get this same output like first one, to get PHPGraphlib read my array.