Código :
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 '' at line 1
mi codigo es el siguiente
Código PHP :
<?
include("../includes/config.php");
include("../includes/funciones.php");
include("../../secure.php");
if(isset($_POST['submit'])){
//borramos el registro.
//nos conectamos a la bd.
$cnx = conectar ();
//consulta sql.
$sql = "DELETE FROM tabla WHERE id=".$_POST['id'];
$res = mysql_query($sql) or die (mysql_error());
//actualizamos el xml.
actualizarXml();
//cerramos la conexión.
mysql_close($cnx);
//mensaje de exito.
$titulo = "Registro Eliminado";
$mensaje = "El registro ha sido Eliminado";
$link = "<a href='index.php'>regresar</a>";
include("../../mensajes.php");
exit;
}
?>este a su vez funciona con un formulario de confirmacion que recibe la variable en GET y la envia po POST
Código :
<form action="<? echo $_SERVER['PHP_SELF']?>" method="post" name="form1"> <tr> <td><input name="id" type="hidden" id="id" value="<? echo $_GET['id'];?>"> </td> </tr> <tr> <td><input type="hidden" name="id" value="<? echo $id;?>"> ¿Eliminar registro : Ref: <? echo $_GET['nom_sql'];?> ?<br></td> </tr> <tr> <td align="right"><input name="submit" type="submit" id="submit" value="Enviar"></td> </tr> </form>
he rebisado el codigo incluso reutilizado el anterior pero me da el mismo error. alguna ayuda?
