Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/10/2007, 13:14
The Neurochild
 
Fecha de Ingreso: marzo-2007
Mensajes: 53
Antigüedad: 17 años, 1 mes
Puntos: 0
Borrado de registros desde PHP

Estoy tratando de borrar los registros de MySQL, indicado el numero del ID.

El problema a pesar de ejecutar la instrucción, no me borra el registro. ¿Que puede estár pasando?

Les dejo el codigo para que se diviertan con el mientras me ayudan a solucionar el problema.
Código PHP:
<?
session_start
();

if (
$_SESSION["autentificado"] != "SI")
    
header("Location: index.php");

if( isset( 
$_POST['Si'] ) ) 

mysql_connect("mysql15.ixwebhosting.com","dicosa_juan","s0ld13r2"); 
mysql_select_db("dicosa_equiphone"); 

$sql "DELETE FROM `reportevisitas` WHERE `id` = ".$_GET["reporte"]." LIMIT 1";

mysql_query($sql);

header("Location: panelvendedores.php?eliminar=ok");

if( isset( 
$_POST['No'] ) )
{
header("Location: panelvendedores.php");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Equiphone :: Eliminaci&oacute;n de registro</title>
<style type="text/css">
<!--
body,td,th {
    color: #000000;
    font-family: Geneva, Arial, Helvetica, sans-serif;
}
body {
    background-color: #FFFFFF;
}
.Estilo7 {font-size: 12px}
a:link {
    color: #000000;
}
a:visited {
    color: #000000;
}
a:hover {
    color: #333333;
}
a:active {
    color: #000000;
}
.Estilo9 {font-size: 12px; color: #FFFFFF; }
-->
</style></head>

<body>
<table width="720" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="3"><img src="images/EquiPhone.jpg" width="303" height="108" /></td>
  </tr>
  <tr>
    <td colspan="3"><p>&nbsp;</p>
    <p align="center">&iquest;Est&aacute; seguro de eliminar el reporte seleccionado?</p>
    <form id="form1" name="form1" method="post" action="<? echo $_SERVER['PHP_SELF']; ?>">
      
        <div align="center">
          <input type="submit" name="Si" id="Si" value="S&iacute;" />
          <input type="submit" name="No" id="No" value="No" />
        </div>
    </form>
    <p>&nbsp;</p></td>
  </tr>
  <tr>
    <td width="200" height="75" bgcolor="#FF0000"><table border="0" align="center" cellpadding="10" cellspacing="0">
      <tr>
        <td><p class="Estilo9">&copy; 2007 Equiphone. <br />
        Todos los derechos reservados. </p>          </td>
      </tr>
    </table></td>
    <td width="520" height="75" colspan="2" bgcolor="#CCCCCC">&nbsp;</td>
  </tr>
</table>
</body>
</html>
Saludos