Ver Mensaje Individual
  #2 (permalink)  
Antiguo 31/03/2009, 13:09
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: De Una Imagen A Otra

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.