Ok, I'm writing a little rating script for my gallery. I want to turn the actual numbers into an image. Yeah, sounds easy, but it's not.
I want to turn
0.1 to 0.4 into one image
0.5 to 0.9 to another
1.0 to 1.4 into another
1.5 to 1.9 into another
And so on....
Here's the code I get to turn a database entry into a number:
$query00 = "SELECT AVG(rated_number) AS average FROM gallery_ratings WHERE image = '$id'";
$result00 = mysql_query($query00);
$row00 = mysql_fetch_assoc($result00);
$ratingx = number_format($row00['average'], 1, '.', '');
if($ratingx == '0.0'){
$rating = '<i>Not Rated</i>';
}
else{
$rating = $ratingx;
}