Hi! That's me again. And I'm still an idiot, and I need yours help.
Terms of tasks:
Show photos with the ratings.
Problem:
Rating display pictures. And if the first base photo have rating 4, the code for all the other photos, too, shows a picture rating 4.
What am I doing wrong?
<?php
$sql="SELECT * FROM photo WHERE type='current'";
$result = mysql_query($sql);
$rating =$row['votes'];
if ($rating >= 0 && $rating <= 1) { $rate = "0"; }
if ($rating >1 && $rating <= 2) { $rate = "../i/shtuki/rt1.gif"; }
if ($rating >2 && $rating <= 3 { $rate = "../i/shtuki/rt2.gif"; }
if ($rating >3 && $rating <= 4) { $rate = "../i/shtuki/rt3.gif"; }
if ($rating >4 && $rating <= 5) { $rate = "../i/shtuki/rt4.gif"; }
if ($rating >5 && $rating <= 6) { $rate = "../i/shtuki/rt5.gif"; }
while($row=mysql_fetch_assoc($result)){
echo '<li>';
echo '<img src="' .$row['path'] . '" class="phb"/>' .'<p>' . $row['user'] . '</p>';
echo "<img src=\"$rate\">" ;
echo '</li>';
}
?>