Ver Mensaje Individual
  #21 (permalink)  
Antiguo 06/04/2007, 01:23
Avatar de sumolari
sumolari
 
Fecha de Ingreso: mayo-2006
Ubicación: localhost
Mensajes: 1.367
Antigüedad: 18 años
Puntos: 18
Re: ¿eliminar un registro en DW8?

Pues si que aparece el ID, pero no borra. este es el código de toda la página:
Código PHP:
<?php require_once('../..//Connections/CMS.php'); ?>
<?php
function GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? "'" doubleval($theValue) . "'" "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}

if ((isset(
$_GET['ID'])) && ($_GET['ID'] != "")) {
  
$deleteSQL sprintf("DELETE FROM CMS WHERE ID=%s",
                       
GetSQLValueString($_GET['ID'], "int"));

  
mysql_select_db($database_CMS$CMS);
  
$Result1 mysql_query($deleteSQL$CMS) or die(mysql_error());

  
$deleteGoTo "index.php";
  if (isset(
$_SERVER['QUERY_STRING'])) {
    
$deleteGoTo .= (strpos($deleteGoTo'?')) ? "&" "?";
    
$deleteGoTo .= $_SERVER['QUERY_STRING'];
  }
  
header(sprintf("Location: %s"$deleteGoTo));
}
?>
<!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>Documento sin t&iacute;tulo</title>
</head>

<body>
<?php echo $_POST['ID']; ?>
</body>
</html>
Supongo que CMS.php no importa, ya que son los datos de la base de datos.