multi aray fra mysql
Jeg har lavet et søjlediagram med Google Bar Chart hvor jeg henter data fra mysql database.$table['cols'] = array(
array('label' => 'Dato', 'type' => 'string'),
array('label' => 'Kg', 'type' => 'number')
);
while($r = mysql_fetch_assoc($veightlistsql)) {
$temp = array();
// the following line will used to slice the Pie chart
$temp[] = array('v' => (string) 'Uge '.$r['valg']);
//Values of the each slice
$i_alt = $i_alt + $r['antal'];
$temp[] = array('v' => $r['antal']);
$rows[] = array('c' => $temp);
}
nu vil jeg gerne lave det med 2 data pr uge.
Hvordan tilføjer jeg $r['vaegt2'] ?
$table['cols'] = array(
array('label' => 'Dato', 'type' => 'string'),
array('label' => 'Vaegt1', 'type' => 'number'),
array('label' => 'Vaegt2', 'type' => 'number')
);
while($r = mysql_fetch_assoc($veightlistsql)) {
$temp = array();
// the following line will used to slice the Pie chart
$temp[] = array('v' => (string) 'Uge '.$r['valg']);
//Values of the each slice
$temp[] = array('v' => $r['vaegt1']);
$rows[] = array('c' => $temp);
}