I wanted to display an image depending on the rating. I got it to display an image, but instead of it displaying the actual rating it displays not Rated image....from after the Else command.
//get the rating
$q5 = "select count(ItemID) as n, sum(Rating) as r from dd_rating where ItemID = '$a5[ItemID]' ";
$r5 = mysql_query($q5) or die(mysql_error());
$a5 = mysql_fetch_array($r5);
if($a5[n] = '5')
{
$Item_RatingImage = "<img src=\"templates/images/5rating.jpg\" border=\"0\">";
}
if($a5[n] = '4')
{
$Item_RatingImage = "<img src=\"templates/images/4rating.jpg\" border=\"0\">";
}
if($a5[n] = '3')
{
$Item_RatingImage = "<img src=\"templates/images/3rating.jpg\" border=\"0\">";
}
if($a5[n] = '2')
{
$Item_RatingImage = "<img src=\"templates/images/2rating.jpg\" border=\"0\">";
}
if($a5[n] = '1')
{
$Item_RatingImage = "<img src=\"templates/images/1rating.jpg\" border=\"0\">";
}
if($a5[n] = '0')
{
$Item_RatingImage = "<img src=\"templates/images/0rating.jpg\" border=\"0\">";
}
else
{
$Item_RatingImage = "<img src=\"templates/images/norating.jpg\" border=\"0\">";
}
Thanks in advance for any help.
here is a link for an example....
Humorzilla!