0); for ($i = 1; $i < $steps-1; $i++) { //$temp=$start . ' - ' . $start+=$width; $data[$start . ' - ' . $start+=$width] = 0; } $data['>'.$start] = 0; $sql = "SELECT * FROM rating_images WHERE `live`=1"; if (!$result=mysql_query($sql,$db_connection)){} while($row = mysql_fetch_array($result)){ $start=-$start; if ($row['score']<$start) { $data['<'.$start]++; } for ($i = 1; $i < $steps-1; $i++) { if ($row['score']>=$start and $row['score']<$start+$width) { $temp=$start . ' - ' . ($start+$width); $data[$temp]++; } $start+=$width; } if ($row['score']>$start) { $data['>'.$start]++; } } //header("Content-type: image/png"); include_once('phpMyGraph5.0.php'); $cfg['title'] = 'Image score distribution'; $cfg['width'] = 500; $cfg['height'] = 250; $cfg['average-line-visible'] = 0; $cfg['file-name'] = 'histogram.png'; $graph = new phpMyGraph(); $graph->parseVerticalSimpleColumnGraph($data, $cfg); ?>