Star Rating
Posted: Wed Aug 29, 2007 1:53 am
I am using
echo $row['votes']+1;
for ($i = 0; $i < (int)$row["rating"]; $i++) {
echo '<img src="rate1.gif">';
}
to show the stars according to the rating.
If i have rating >4.5 then it comes to 4 after type casting and show 4 stars. However i want to show another half star image for anything > 4.49 and below 5 ... or 3.49 and below 4.
That means if the rating is 4.57 then it should show 4 rate1.gif image and then one half star image. How to do this?
echo $row['votes']+1;
for ($i = 0; $i < (int)$row["rating"]; $i++) {
echo '<img src="rate1.gif">';
}
to show the stars according to the rating.
If i have rating >4.5 then it comes to 4 after type casting and show 4 stars. However i want to show another half star image for anything > 4.49 and below 5 ... or 3.49 and below 4.
That means if the rating is 4.57 then it should show 4 rate1.gif image and then one half star image. How to do this?