The problem is here:
PHP Code:
while ($i=mysql_fetch_array($result_rat))
{
$i++;
$j= $row_rt['rat_num'] + $j;
}
Once the while loop terminates $i is equal to null.
Technically in PHP 0 == NULL so the line:
will always be a division by 0.
One other thing: I don't understand why you are incrementing i in the while loop; it isn't a numeric value.
|