Sorry for a slight duplication of Q but I think the previous answers are now depreciated (I've seen that in PHP 5.3 you need you use MySQLi_fetch_array())
I'm using jpgraph and trying to pull my data from a MySQL database. I have the following code which pulls the figures I need and when I echo the result it spits out the answers one by one no problem but it won't then put it into an array.
I'm trying to replace a line which is
$ydata = array(1,2,3,4,5,6,7);
//query
$sql = "SELECT CONCAT( 'Week ', WEEK( TimeofCompletion ) , ' ', YEAR( TimeofCompletion ) ) AS Week, Count( * ) AS VolumeOfAnswers
FROM table01
GROUP BY WEEK( TimeofCompletion ) , YEAR( TimeofCompletion )
ORDER BY TimeofCompletion";
$ydata = array();
while($row = mysql_fetch_array($sql)){
// Create a temporary array
$temp = array();
$temp[] = "".$row['VolumeOfAnswers']."";
$ydata = '['. implode(', ', $temp) . ']';
}
Any suggestions how I would get the output by row into an array?
Regards Maudise