I have alittle PHP snippet in a While loop and i am getting
into problems while converting it
$sql = "select rating from r_ratings where iid = $iid";
$result3 = mysql_query($sql ,$db);
if ($myrow2 = mysql_fetch_array($result3)) {
do {
$ratetotal = $ratetotal + $myrow2["rating"];
$ratecount++;
} while ($myrow2 = mysql_fetch_array($result3));
}
$newrate = $ratetotal / $ratecount;