Ver Mensaje Individual
  #3 (permalink)  
Antiguo 03/10/2003, 14:42
Avatar de asinox
asinox
 
Fecha de Ingreso: enero-2002
Ubicación: Santo Domingo
Mensajes: 2.712
Antigüedad: 22 años, 3 meses
Puntos: 6
si eso quiero, pero mira de donde lo tomo de este codigo?
no logro identificar de donde tomar el $row['Id'] de esto....
Código 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(
$HTTP_GET_VARS['Id'])) && ($HTTP_GET_VARS['Id'] != "")) {
  
$deleteSQL sprintf("DELETE FROM products WHERE Id=%s",
                       
GetSQLValueString($HTTP_GET_VARS['Id'], "int"));

  
mysql_select_db($database_oConnPep$oConnPep);
  
$Result1 mysql_query($deleteSQL$oConnPep) or die(mysql_error());

__________________
www.dataautos.com