Hey guys, I have been using the following code to put data from a query into the arrays as shown below.
However there will be some cases where the data will have to be calculated from the one or more queries and stored in an array before the while loop can be performed. So I was wondering how do you perform the same while loop but with the results stored in an array as the mysql_fetch_array would not work?
mysql_select_db("gra",$db) or die(mysql_error());
$query = mysql_query("SELECT name, count(*) FROM gra group by name") or die(mysql_error());
while($getData = mysql_fetch_array($query)){
$points[] = $getData[1];
$months[] = $getData[0];
}