Ver Mensaje Individual
  #2 (permalink)  
Antiguo 15/05/2009, 06:35
DarkKing
 
Fecha de Ingreso: noviembre-2006
Mensajes: 166
Antigüedad: 17 años, 5 meses
Puntos: 4
Respuesta: Mostrar registros (fotos) en 2 columnas

Prueba así a ver que tal:
Código PHP:
<?php 
$link 
mysql_connect("localhost""root""password");
mysql_select_db("base_de_datos"$link);
 
$query="SELECT Nombre, Cargo, Foto FROM directores ";
$rst=mysql_query($query) or die(mysql_error());
$Maximo=3;
$Contador 1;
while (
$row=mysql_fetch_assoc($rst)) {
    if (
$Contador == 1) {
        echo 
"<tr><table border='1' cellpadding='0' cellspacing='0' width='507' align='center'>";
    }
    echo 
"<td  colspan='2' width='10%'><img src='../uploads/directores/th$row[Foto]' /><br>$row[Nombre]<br>$row[Cargo]</td>";
    if (
$Contador == $Maximo) {
        echo 
"</tr></table>";
        echo 
"<table border='1' cellpadding='0' cellspacing='0' width='507' align='center'>";
        
$Contador 0;
    }
    
$Contador++;
}
?>

Última edición por DarkKing; 15/05/2009 a las 06:47 Razón: corrección