![Neurótico](http://static.forosdelweb.com/fdwtheme/images/smilies/scared.png)
Esto Error me aparece
Error al insertar en la tabla egresadoYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real, centro) VALUES ('','','','','','','', '','','','','','','','','','','', ''' at line 1
Código PHP:
<?php
include("conexion.php");
mysql_select_db($DB,$db);
$nom = $_POST['nombre'];
$apellid = $_POST['apellidop'];
$apellido = $_POST['apellidom'];
$call = $_POST['calle'];
$n = $_POST['no'];
$coloni = $_POST['colonia'];
$municipi = $_POST['municipio'];
$estad = $_POST['estado'];
$telefo = $_POST['telefono'];
$c = $_POST['cp'];
$emai = $_POST['email'];
$titula= $_POST['titulado'];
$op_titulaci = $_POST['op_titulacion'];
$anio_ingre = $_POST['anio_ingreso'];
$anio_egre = $_POST['anio_egreso'];
$eda = $_POST['edad'];
$gene = $_POST['genero'];
$edo_civ = $_POST['edo_civil'];
$med = $_POST['medio'];
$ambi = $_POST['ambito'];
$activid = $_POST['actividad'];
$conteni = $_POST['contenido'];
$objeti = $_POST['objetivo'];
$actu = $_POST['actual'];
$estud = $_POST['estudio'];
$tipo_estu = $_POST['tipo_estudio'];
$posgra = $_POST['posgrado'];
$instituci = $_POST['institucion'];
$traba = $_POST['trabaja'];
$desarroll = $_POST['desarrollo'];
$carre = $_POST['carrera'];
$solicit = $_POST['solicitado'];
$luga = $_POST['lugar'];
$organis = $_POST['organismo'];
$nmbre_e = $_POST['nombre_e'];
$clle_e = $_POST['calle_e'];
$n_e = $_POST['no_e'];
$colon_e = $_POST['colonia_e'];
$esta_e = $_POST['estado_e'];
$municip_e = $_POST['municipio_e'];
$c_e = $_POST['cp_e'];
$telefo_e = $_POST['telefono_e'];
$fa_e = $_POST['fax_e'];
$pagi_e = $_POST['pagina_e'];
$ema_e = $_POST['email_e'];
$numer = $_POST['numero'];
$activid_p = $_POST['actividad_p'];
$nomin = $_POST['nominal'];
$rea= $_POST['real'];
$cent = $_POST['centro'];
//echo $mysql = sprintf("INSERT INTO pruebas (nombre) VALUES '%s';",mysql_real_escape_string($_POST['nombre']));
//$nom=$_POST['nombre'];
echo $nom;
$mysql = "INSERT INTO egresado (nombre,apellidop,apellidom,calle,no, colonia, municipio, estado, telefono, cp, email, titulado, op_titulacion, anio_ingreso, anio_egreso, edad, genero, edo_civil, medio, ambito, actividad, contenido, objetivo, actual, estudio, tipo_estudio, posgrado, institucion, trabaja, desarrollo, carrera, solicitado, lugar, organismo, nombre_e, calle_e, no_e, colonia_e, estado_e, municipio_e, cp_e, telefono_e, fax_e, pagina_e, email_e, numero, actividad_p, nominal, real, centro) VALUES ('$nom','$apellid','$apellido','$call','$n','$coloni','$municipi', '$estad','$telefo','$c','$emai','$titula','$op_titulaci','$anio_ingre','$anio_egre','$eda','$gene','$edo_civ', '$med','$ambi','$activid','$conteni','$objeti','$actu','$estud','$tipo_estu','$posgra','$instituci','$traba','$desaroll', '$carre','$solicit','$luga','$organis','$nmbre_e','$clle_e','$n_e','$colon_e','$esta_e','$municip_e','$c_e','$telefo_e','$fa_e','$pagi_e','$ema_e','$numer','$activid_p','$nomin','$rea','$cent')";
/*$mysql = "INSERT INTO egresado(nombre, apellidop, apellidom, calle, no, colonia, municipio, estado, telefono, cp, email, titulado, op_titulacion, anio_ingreso, anio_egreso, edad, genero, edo_civil, medio, ambito, actividad, contenido, objetivo, actual, estudio, tipo_estudio, posgrado, institucion, trabaja, desarrollo, carrera, solicitado, lugar, organismo, nombre_e, calle_e, no_e, colonia_e, estado_e, municipio_e, cp_e, telefono_e, fax_e, pagina_e, email_e, numero, actividad_e, nominal, real, centro)
VALUES( '$nom', '$apellid','$apellido','$call','$n','$coloni','$municipi','$estad','$telefo','$c','$emai','$titula','$op_titulaci','$anio_ingre','$anio_egre','$eda','$gene','$edo_civ','$med','$ambi','$activid','$conteni','$objeti','$actu','$estud','$tipo_estu','$posgra','$instituci','$traba','$desarroll','$carre','$solicit','$luga','$organis','$nmbre_e','$clle_e','$n_e','$colon_e','$esta_e','$municip_e','$c_e','$telefo_e','$fa_e','$pagi_e','$ema_e','$numer','$activid_e','$nomin','$rea','$cent')";
*/
$result = mysql_query($mysql,$db);
if(!$result){exit("Error al insertar en la tabla egresado".mysql_error());}
switch ($_POST['a_donde']){
case 2:
echo"<script>
alert(\"Tus Datos Fueron Almacenados Correctamente\")
</script>";
//echo "<center><span class=PHP3>Tus datos fueron almacenados exitosamente GRACIAS!<br>
// </span></center>";
echo "<script> window.location.href='egresados2.php'</script>";
break;
case 3:
echo"<script>
alert(\"Tus Datos Fueron Almacenados Correctamente\")
</script>";
//echo "<center><span class=PHP3>Tus datos fueron almacenados exitosamente GRACIAS!<br>
// </span></center>";
echo "<script> window.location.href='egresados3.php'</script>";
break;
case 4:
echo"<script>
alert(\"Gracias por Llenar sus Datos\")
</script>";
//echo "<center><span class=PHP3>Tus datos fueron almacenados exitosamente GRACIAS!<br>
// </span></center>";
echo "<script> window.location.href='egresados4.php'</script>";
break;
default:
echo "No Hay ningun formulario";
}
?>