Ver Mensaje Individual
  #16 (permalink)  
Antiguo 03/06/2009, 13:36
Avatar de Triby
Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 9 meses
Puntos: 2237
Respuesta: Como muestro imagen siguiente y anterior en galeria de imagenes?

Bueno, teniendo esto:
Código php:
Ver original
  1. $id_pastora=$_GET['id_pastora'];
  2.  
  3. //Obtener anterior imagen
  4. $estructura = "SELECT id_pastora, imagen_pastora FROM galeriapastora WHERE id_pastora <= $id_pastora LIMIT 1";

Si MySQL reporta el siguiente error:
Cita:
Error: (SELECT id_pastora, imagen_pastora FROM galeriapastora WHERE id_pastora < LIMIT 1 )You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 1
es porque $id_pastora es nulo, ergo $_GET['id_pastora'] tambien.

Intenta por favor lo siguiente:
Código php:
Ver original
  1. if(isset($_GET['id_pastora']))
  2.     $id_pastora=$_GET['id_pastora'];
  3. else
  4.     die('id_pastora esta vacio');
__________________
- León, Guanajuato
- GV-Foto