I'm trying to create line chart so i'm using highcarts and they have the code for it but i just don't know how i put my sqlite database value on it. I thought of changing the value by my self but again if the database data changes i have to do it again. so i though i will use json_encode
<?php
$db = new PDO('sqlite:randvalue.sqlite');
$sth = $db->query('SELECT revenue_value FROM company');
$sth->execute();
$results=$sth->fetchAll(PDO::FETCH_ASSOC);
$json=json_encode($results);
echo $json
?>
and the result is
but the code highchart provided has a different format
the full code highchart provided http://ift.tt/1k1aRS4
so how do I implement my sqlite database value on to highchart code. To be honest i have no idea what i'm saying or doing.
Aucun commentaire:
Enregistrer un commentaire