Ver Mensaje Individual
  #21 (permalink)  
Antiguo 16/02/2010, 08:36
patricia:)
 
Fecha de Ingreso: abril-2006
Ubicación: Venezuela
Mensajes: 126
Antigüedad: 18 años
Puntos: 0
Respuesta: form de busqueda, modificacion y eliminacion

listo ya resolvi era la forma en el deletealumno.php de como recibia el valor de t1.

lo soluciones con esto:

Código:
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['t1'])) && ($_GET['t1'] != "")) {
   
   
   $con=mysql_connect("localhost","root","123");
   mysql_select_db("controlestudio",$con);
   $sql=sprintf("delete FROM alumnos WHERE CI_alumno =%s",
                    GetSQLValueString($_GET['t1'], "int"));
   $resultado=mysql_query($sql,$con);
   if(mysql_affected_rows()!=0)
   {
    echo "registro eliminado";
      
   } else {
       echo "el t1 esta en blanco";
   }
   //mysql_free_result($resultado);
   mysql_close($con);
   
   
  }
ahora si me elimina perfectamente