Ver Mensaje Individual
  #5 (permalink)  
Antiguo 05/09/2011, 12:32
aherrero96
 
Fecha de Ingreso: abril-2011
Mensajes: 10
Antigüedad: 13 años, 10 meses
Puntos: 0
Respuesta: PHP, Bases de datos y tablas html

Cita:
Iniciado por malakian Ver Mensaje
mmmm entonces este tema que soluciones le servira

[URL="http://www.forosdelweb.com/f18/tablas-while-problemas-857281/"]http://www.forosdelweb.com/f18/tablas-while-problemas-857281/[/URL]
Muchas gracias, era lo que buscaba, ha quedado así

Código PHP:
<?php
echo "<table><tr>";
$query=mysql_query("SELECT nombre FROM gente");
$contador=1;
while (
$row=mysql_fetch_array($query)){
if (
$contador == 4){
echo 
"</tr><tr>";
$contador=1;
}
echo 
"<td>".$row['nombre']."</td>";
$contador++;
}
echo 
"</tr></table>";
?>