I have a problem with a while statement in PHP and mysql that I have been trying to figure out for ages, I hope you can help me.
I have a while statement, and inside that I have two if statements. It seems to be working, except it displays the first entry in the array only, multiple times.
<?php
$i=1;
while($i<5){
if ($data_review_list['review'] > 4){
echo "<img src=\"images/good.png\" />\n";
}
else{
echo "<img src=\"images/bad.png\" />\n";
}
echo $data_review_user['user_name'];
echo $data_review_list['review_msg'];
$i++;
}
?>
I have put ($i<5) as using ($i!=0) was give me a long list of the first entry. This gives me the first entry 5 times.
What am I doing wrong? How can I get the second etc entry to display?
Thank you!