Ver Mensaje Individual
  #3 (permalink)  
Antiguo 27/02/2012, 15:09
StevenLlaja
 
Fecha de Ingreso: mayo-2011
Mensajes: 15
Antigüedad: 13 años
Puntos: 0
Respuesta: Mostrar datos en una tabla horizontal y vertical

Genial @repara2, me ha servido de maravilla, aunque tuve que craner un poquito como hacerlo con mysql, si a alguien le sirve, aquí dejo el código:

Código PHP:
<?php
$resultados
=mysql_query("aqui_tu_consulta");
 
$limite 4;
     


$table "<table border=\"1\"  cellspacing=\"0\" bgcolor=\"#9999CC\" width=\"160\" height=\"150\" >";
    for(
$i 1;$i<mysql_num_rows($resultados);$i++){
        
$fotourl=mysql_result($resultados,$i,"ruta_foto");
$ruta="imagenes/eventos/";
$ruta=$ruta.$fotourl;
        if(
$i%$limite==1)$table .="<tr>";
        
$table .= "<td><img src=\"$ruta\" width=\"200\" height=\"200\"/></td>";
        if(
$i%$limite==0)$table .="</tr>";
    }
    
$table .= "</table>";
     
    echo 
$table;

$i++;
}
?>