Designing a review section in php....having infinite loop error

Hi Forum,

I am designing review section for my website…but at the time of execution is flagging a infinite loop…Please help as it is important.

Here’s the code

$biz_val= $row_c['business_id'];
                        $sql_rat="select * from tblrating where rat_biz_id = ".$row_c['business_id']."";
					    $result_rat = mysql_query($sql_rat);
						$tot_rec = mysql_fetch_array($result_rat);
						$i=$j=$d=0;
						$row_rt = 0;
					if($tot_rec>0)
					{		$row_rt = $tot_rec;
						while ($i==$row_rt)
						{
							$i++;
							$j= $row_rt['rat_num'] + $j;
						}	
						$d=$j/$i;
                          if ($d<=1.50)
{
        echo "<img src=\\"rat1.gif\\">"
    }
    if ($d<=2.50 && $d>=1.51)
{
        echo "<img src=\\"rat2.gif\\">"
    }
}

Any of your suggestion would be highly appreciated.

Thanks

Any body!!!..help!!!

This is the section that the infinite loop is occuring in.


while ($i==$row_rt) 
{ 
    $i++; 
    $j= $row_rt['rat_num'] + $j; 
}     

var_dump is commonly used to help debug variable issues.