Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/02/2008, 11:36
Avatar de picazamora
picazamora
 
Fecha de Ingreso: febrero-2008
Ubicación: Zamora
Mensajes: 72
Antigüedad: 16 años, 2 meses
Puntos: 0
problema para borrar registro

hola

soy novato y etoy construyendo una web y e tenido un problemilla, que es al borrar los registros, creo q es un problema de versión de mysql ya q en el servidor de casa me funciona bien pero al subirlo en el server externo no me borra los datos aqui les dejo el codigo para ver si veis el error.

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 "DELETE FROM agenda WHERE id=".$_POST['id'];
        
$res mysql_query($sql) or die (mysql_error());
        
//actualizamos xml de agenda
        
actualizarXmlAgenda();
        
//cerramos la con
        
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;
}

if(empty(
$_GET['id'])){
        
header("Location: index.php");
}
?>

<html>
<head>
<title>agenda_eliminar</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../estilos.css" rel="stylesheet" type="text/css">
</head>
<body>
<form action="<? echo $SERVER['PHP_SELF']?>" method="post" name="form1">
  <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td height="30" class="cabeceraBold">        Eliminar Registro</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
    <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 : <? echo $_GET['cabecera'];?> ?<br>
      </td>
    </tr>
    <tr>
      <td align="right"><input name="submit" type="submit" id="submit" value="Enviar"></td>
    </tr>
    <tr>
      <td height="30" class="pie"><a href="index.php">regresar</a></td>
    </tr>
  </table>
</form>
</body>
</html>

mi version de sql en mi servidor es phpMyAdmin 2.6.2-pl1
la del server esterno es la 5.0

gracias