Ver Mensaje Individual
  #3 (permalink)  
Antiguo 31/03/2009, 13:14
Avatar de dannce4life
dannce4life
 
Fecha de Ingreso: junio-2008
Ubicación: localhost
Mensajes: 137
Antigüedad: 15 años, 10 meses
Puntos: 6
Respuesta: De Una Imagen A Otra

Cita:
Iniciado por GatorV Ver Mensaje
Agrega un LIMIT 1 a tu consulta, y para que al pulsar eso lo haces usando una etiqueta <a> en tu imagen, prueba esto:
Código php:
Ver original
  1. $id = (int) $_GET['id'];
  2. if(empty($id) {
  3.        $result = mysql_query("SELECT * FROM fotos LIMIT 2");
  4. } else {
  5.        $result = mysql_query("SELECT * FROM fotos WHERE id > $id LIMIT 2");
  6. }
  7. $row = mysql_fetch_array($result);
  8. $next = mysql_fetch_array($result);
  9. $next_id = $next['id'];
  10. echo "<a href=\"".$_SERVER['PHP_SELF']."?id=$next_id\"><img src=\"$row[Foto]\"></a>";

Saludos.
exelente, no se me habia ocurrido asi.
__________________
Gracias