Ver Mensaje Individual
  #5 (permalink)  
Antiguo 07/04/2011, 15:44
Avatar de jorge_developer
jorge_developer
 
Fecha de Ingreso: abril-2011
Ubicación: Lima
Mensajes: 26
Antigüedad: 13 años
Puntos: 2
Respuesta: Mostrar resultados horizontalmente

hola quiza te sirva mi codigo

Código PHP:
Ver original
  1. <?php
  2. echo "<table border='1'>";
  3. $cols = 1;
  4. // tu codigo sql
  5. while($row = mysql_fetch_array($result)) {  
  6.     //Abrimos la fila
  7.     if($cols == 1) { echo "<tr>"; }
  8.    
  9.     echo "<td>".$row['id']."</td>";
  10.     // si llega hay 20 celdas horizontales cerramos la fila
  11.     if($cols == 20) { echo "</tr>"; $cols = 0; }
  12.    
  13.     $cols++;
  14. }
  15. echo "</table>";
  16. ?>