x1:".$mnth[$i].": y1:50: x2:".($mnth[($i+1)]-1).": y2:".(582 - (20 * ($k[1] + 2)))."

\n"; $col = imagecolorallocate($im,255,255,0); imagestringup($im,5,$mnth[$i] + 25,575,"(".$k[2].")",$col); } $sqlq = "select tmp_day, tmp_month, avg(tmp_temp) from temps group by tmp_month, tmp_day order by tmp_month, tmp_day"; #$rs = mssql_query($sqlq); #$NumRows = mssql_num_rows($rs); $rs = mysql_query($sqlq); $NumRows = mysql_num_rows($rs); $end_x = 770; $last_x = 42; $col = imagecolorallocate($im,255,255,0); for ($i=1;$i<=$NumRows;$i++) { # $k = mssql_fetch_row($rs); $k = mysql_fetch_row($rs); $thedate = mktime(0,0,0,$k[1],$k[0],'2004'); if ($i == 1) { $last_y = 582 - (20 * ($k[2] + 2)); $end_y = $last_y; } $this_x = (date('z',$thedate) * 2) + 42; $this_y = 582 - (20 * ($k[2] + 2)); #echo "

x1: ".$last_x.": this_x".$this_x.": last_y:".$last_y.": this_y:".$this_y."

"; imageline($im,$last_x,$last_y,$this_x,$this_y,$col); $last_x = $this_x; $last_y = $this_y; } imageline($im,$last_x,$last_y,$end_x,$end_y,$col); header("Content-type: image/png"); imagepng($im); ?>