hai ragione...
prova a portare il $i++ subito dopo il while


codice:
...
$i=0;
while($risu=mysql_fetch_array(...)) {
 $i++;
?>
....
ciao