Ver Mensaje Individual
  #4 (permalink)  
Antiguo 25/02/2012, 10:32
Avatar de ColdFusion
ColdFusion
 
Fecha de Ingreso: octubre-2008
Ubicación: Tocoa, Colon Honduras C.A.
Mensajes: 419
Antigüedad: 15 años, 6 meses
Puntos: 9
Respuesta: Insertar código tras X repeticiones While

Mas facil aun

Código PHP:
Ver original
  1. <?php
  2. $repeticion=1;
  3. while($row = mysql_fetch_array($result)){
  4.     echo "<td><table>
  5.    <td><center>$row[marca] <br> $row[nombre]</center></td>
  6.    </tr>
  7.    <tr>
  8.    <td></center><img src='script/resources/decks/$row[imagen].png'></center></td>
  9.    </tr>
  10.    <tr>
  11.    <td><center><input type='radio' name='$row[imagen]'></center></td>
  12.    </tr>
  13.    </table></td>";
  14. //Si la repeticion es igual a 6, imprimimos
  15. if ($repeticion==6) {
  16.  echo "<br>";
  17.  $repeticion==0; //reiniciamos las repeticiones
  18. }
  19.  
  20. $repeticion++;
  21.  
  22. }
  23. ?>