Hola,
Lees un registro sin mostrarlo al hacer despues del while el if. Desarrollando ese bucle lo que haces es:
Código PHP:
//do{
for($i=0;$i<3;$i++){
if($row=mysql_fetch_array($cat)){
echo($row["categoria"]);
echo(" ");
}
}
echo("<br><br>");
}
mysql_fetch_array($cat); //while(mysql_fetch_array($cat));
//do{
for($i=0;$i<3;$i++){
if($row=mysql_fetch_array($cat)){
echo($row["categoria"]);
echo(" ");
}
}
echo("<br><br>");
}
mysql_fetch_array($cat); //while(mysql_fetch_array($cat));
// y asi continuamente
Como ves, lees un registro en el mysql_fetch_array() en el while, no lo almacenas en ningun sitio, y despues lees el siguiente registro en el if y lo muestras.
Saludos.