I'll have to show you what I have so far because I still can't see how this is going to work. Sorry for my stupidity!!
QUERY:
$asthma5_40Query =
"SELECT measure, periodYear, periodMonth FROM measureTemp
WHERE practiceID = '" . $_SESSION['practiceID'] . "'
AND questionRecID = 1
ORDER BY periodYear, periodMonth";
EXECUTE QUERY AND GET TOTAL NUMBER OF RESULTS:
$asthma5_40Res = mysql_query($asthma5_40Query);
$queryNumRes = mysql_num_rows($asthma5_40Res);
LOOP THROUGH QUERY RESULTS:
while($row = mysql_fetch_array($asthma5_40Res)){
$mArray[] = $row['periodMonth'];
$yArray[] = $row['periodYear'];
$measureArray[] = $row['measure'];
}//end while
GET FIRST, LAST MONTH AND FIRST, LAST YEAR:
$firstMonth = $mArray[0];
$lastMonth = $mArray[$queryNumRes - 1];
$firstYear = min($yArray);
$lastYear = max($yArray);
THIS IS THE FUNCTION WRITEN BY SILKFIRE:
function generate_month_range($month_start, $year_start, $month_end, $year_end) {
$array = array();
$start_time = mktime(0, 0, 0, $month_start, 1, $year_start);
$end_time = mktime(0, 0, 0, $month_end + 1, 1, $year_end);
$months_count = round(($end_time - $start_time) / 2629743);
for ($m = 0; $m < $months_count; $m++) {
$date = strtotime("+$m months", $start_time);
$array[date('Y', $date)][date('n', $date)] = '';
}
return $array;
I'm sorry, but I still don't see how to pass months, years and measures to this function and output it.
To maybe help you understand it better, to graph it, this is the format that needs to be passed to the xml file, which I'm writing on the fly with PHP.
<set label=$periodMonth . "/" . $periodYear . "\" value=\"" . $measure . "\"/>";
Your help is greatly appreciated.
I'm really frustrated with the fact that I can't see something that's sounds really simple