Ver Mensaje Individual
  #4 (permalink)  
Antiguo 31/05/2011, 05:17
cabritillo77
 
Fecha de Ingreso: mayo-2011
Mensajes: 33
Antigüedad: 13 años
Puntos: 4
Respuesta: [problema] mostrar 6 imagenes a la vez

He modificado el codigo para intentar sacar lo que queria las 6 fotos en fila, pero no lo consigo. me devuelve 6 filas, la primera sin fotos, la segunda con 1 foto, la tercera con 2 fotos, la cuarta con 3 fotos, la quinta con 4 fotos y la sexta con 5 fotos.
No se que hago mal:

Código PHP:
<?
include_once"db-cnx.php";
if(isset(
$_GET['enviar'])){
    
// asignamos los valores
    // a las variables que usaremos
    
$tituloevento $_GET['tituloevento'];
    
    
}
$sqlevento mysql_query("SELECT tituloevento, fotos FROM eventos order by ideventos DESC"$db_link) or die(mysql_error);

if (
mysql_num_rows($sqlevento)){
    
        
while(
$evento mysql_fetch_array($sqlevento)){
$fotos[] = $evento[fotos]; 
$numfotos count($evento[fotos]);
$valor 6;
?>    


<body bgcolor="#FFE821">
<center>
<font color="steelblue"><b>FOTOS DE ACTOS,CAMPEONATOS Y EQUIPOS</b></FONT>
</center>
<HR size="5" COLOR="NAVY">
<?
echo"<table>";

echo
"<tr>";
if(
$numfotos $valor){ 
            echo 
"<tr>"
         }
         echo 
"<td width='' height=''><a href='imagesr2011/$fotos[1]'>"
        echo 
"<img src='imagesr2011/$fotos[1]' width='100' height='100'"
        echo 
" border=0>"
        echo 
""
        echo 
"</td>";
        echo 
"<td width='' height=''><a href='imagesr2011/$fotos[2]'>"
        echo 
"<img src='imagesr2011/$fotos[2]' width='100' height='100'"
        echo 
" border=0>"
        echo 
""
        echo 
"</td>";
        echo 
"<td width='' height=''><a href='imagesr2011/$fotos[3]'>"
        echo 
"<img src='imagesr2011/$fotos[3]' width='100' height='100'"
        echo 
" border=0>"
        echo 
""
        echo 
"</td>";
        echo 
"<td width='' height=''><a href='imagesr2011/$fotos[4]'>"
        echo 
"<img src='imagesr2011/$fotos[4]' width='100' height='100'"
        echo 
" border=0>"
        echo 
""
        echo 
"</td>";
        echo 
"<td width='' height=''><a href='imagesr2011/$fotos[5]'>"
        echo 
"<img src='imagesr2011/$fotos[5]' width='100' height='100'"
        echo 
" border=0>"
        echo 
""
        echo 
"</td>";
        echo 
"<td width='' height=''><a href='imagesr2011/$fotos[6]'>"
        echo 
"<img src='imagesr2011/$fotos[6]' width='100' height='100'"
        echo 
" border=0>"
        echo 
""
        echo 
"</td>";
        if(
$numfotos >= $valor){// si es mayor o igual añadimos </TR> 
            
echo "</tr>"
            
$numfotos 0;//seteamos a 0 el sumador y volvemos a empezar si quedan mas imagenes 
        
}//end if 
        
$numfotos++;
        
        echo 
"</tr>";
        echo 
"</table>"

 
echo
"<HR size='5' COLOR='NAVY'>";

}
} else {
    echo 
"No hay eventos para mostrar";
}
?>