I'm trying to adjust a php chart library on my code with some data fetched from a database. I am too close but i think i am confused with all these arrays. I will try to explain as easy as possible. The appropriate form of constructing the data that my library needs to read in order to create a php chart is the following:
//With this value my api displays the chart normally
$p->data = array(array(array("2015/10/10",44),array("2015/10/11",56)));
The way i'm trying to construct the aforementioned array is the following
//Fetch results from database and push values into an array
while($row = mysqli_fetch_array($result)){
$values[] = array($row['Date'] => $row['Total']);
}
$p->data = array(array($values));
But unfortunately the chart is not displaying my values. How can i fix my code in order to achive this format:
$p->data = array(array(array("2015/10/10",44),array("2015/10/11",56)));