0

i need the output like below.i want to generate a graph for my report so i need the result in mysql_fetch_assoc. i am new to this concept. basically am doing mysql_fetch_array thats all but now i need the associative array function.

$date = array("date" => reading);

$data = array("28-Sep-2012" => .0032, "27-Sep-2012" => .0028, "29-Sep-2012" => .0021,
"24-Sep-2012" => .0033);
4

1 回答 1

0

像这样试试

$results = mysql_query("SELECT vaccum_value,date FROM vaccum_details where serial_number='10P1005'");
$data=array();
while ($row = mysql_fetch_array($results))
{ 
    $data[$row['date']]=$row['vaccum_value'];
}

print_r($data);
于 2012-10-09T11:24:11.477 回答