Ver Mensaje Individual
  #2 (permalink)  
Antiguo 29/05/2011, 19:29
Avatar de memoadian
memoadian
Colaborador
 
Fecha de Ingreso: junio-2009
Ubicación: <?php echo 'México'?>
Mensajes: 3.696
Antigüedad: 14 años, 10 meses
Puntos: 641
Respuesta: [problema] mostrar 6 imagenes a la vez

si lo que quieres es mostrar el primer titulo puedes usar una condicional.

Código PHP:
Ver original
  1. <?php
  2. include_once"db-cnx.php";
  3. if (isset($_GET['enviar'])) {
  4.     $tituloevento = $_GET['tituloevento'];
  5. }
  6. $sqlevento = mysql_query("SELECT * FROM eventos order by eventos.tituloevento DESC", $db_link) or die(mysql_error);
  7.  
  8. if (mysql_num_rows($sqlevento)) {
  9.     $i = 1;//introducimos contador
  10.     while ($evento = mysql_fetch_array($sqlevento)) {
  11. ?>
  12.         <table>                
  13.             <tr>                
  14.                 <td><?php if ($i == 1) {//si el contador dice que es el primer ciclo
  15.             echo $evento['tituloevento'];//ponemos el titulo
  16.         } ?></td>        
  17.             </tr>                
  18.             <tr>                
  19.                 <td>                
  20.                     <a href="imagesr2011/'.$evento[fotos].'"><img src="imagesr2011/'.$evento[fotos].'"                
  21.                                                                   width="100" height="100"></a>                
  22.                 </td>                
  23.             </tr>                
  24.         </table>        
  25. <?php
  26.         $i++;
  27.     }
  28. } else {
  29.     echo "No hay eventos para mostrar";
  30. }
  31. ?>