Estoy teniendo un problema, me da este error:
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.
El codigo lo llevo asi:
Código PHP:
<?php
session_start();
// incluimos el archivo de conexion
include ('../../usuarios/reg/config.php');
$id_pastora=$_GET['id_pastora'];
//Obtener anterior imagen
$estructura = "SELECT id_pastora, imagen_pastora FROM galeriapastora WHERE id_pastora < $id_pastora LIMIT 1 ";
$sqlQueryNot = mysql_query($estructura, $db_link) or die(mysql_error());
$rowNot = mysql_fetch_array($sqlQueryNot);
//Obtener actual y siguiente
$estructura2 = "SELECT id_pastora, imagen_pastora FROM galeriapastora WHERE id_pastora >= $id_pastora LIMIT 2";
$sqlQueryNot2 = mysql_query($estructura2, $db_link) or die(mysql_error());
$rowNot2 = mysql_fetch_array($sqlQueryNot2);
echo "<div id=\"verfoto\"><img src=\"".$rowNot['imagen_pastora']."\" border=\"0\" alt=\"Descripcion\" /></div>";
$anterior = (mysql_num_rows($estructura) > 0) ? mysql_fetch_array($estructura) : false;if($anterior !== false) {
echo "Hay mas imagenes por eso sale esto";
} // Aqui muestras el link a la imagen anterior
?>