aqui el codigo
Código PHP:
Ver original
<?php <body> <?php include ("config.php"); if (!$con) { } if (!$db_selected) { } $post_ano = $_POST['ano']; $post_numero = $_POST['numero']; $post_folio = $_POST['folio']; $post_fecha = $_POST['fecha']; $post_aut = $_POST['nombre_aut']; $post_cargo = $_POST['cargo']; $post_cedula_aut = $_POST['cedula_aut']; $post_sexo = $_POST['sexo']; $post_dia = $_POST['dia']; $post_mes = $_POST['mes']; $post_year = $_POST['year']; $post_hora = $_POST['hora']; $post_minutos = $_POST['minutos']; $post_am_pm = $_POST['am_pm']; $post_cedula_testigo1 = $_POST['cedula_testigo1']; $post_cedula_testigo2 = $_POST['cedula_testigo2']; $post_cedula_madre = $_POST['cedula_madre']; $post_edad_madre = $_POST['edad_madre']; $post_nacionalidad_madre = $_POST['nacionalidad_madre']; $post_civil_madre = $_POST['civil_madre']; $post_cedula_padre = $_POST['cedula_padre']; $post_edad_padre = $_POST['edad_padre']; $post_nacionalidad_padre = $_POST['nacionalidad_padre']; $post_civil_padre = $_POST['civil_padre']; $post_cedula_otro = $_POST['cedula_otro']; $post_edad_otro = $_POST['edad_otro']; $post_nacionalidad_otro = $_POST['nacionalidad_otro']; $post_civil_otro = $_POST['civil_otro']; $post_usuario = $_SESSION['username']; $post_presentacion = $_POST['rad_presentacion']; if ($post_presentacion == 'rad_padre') { $post_pre_padre = 1; $post_pre_madre = 0; $post_pre_otro = 0; } if ($post_presentacion == 'rad_madre') { $post_pre_padre = 0; $post_pre_madre = 1; $post_pre_otro = 0; } if ($post_presentacion == 'rad_otro') { $post_pre_padre = 0; $post_pre_madre = 0; $post_pre_otro = 1; } $post_op_marginal = $_POST['rad_marginal']; if ($post_op_marginal == 'nota_si') { $post_op_marginal_t = "SI"; } if ($post_op_marginal == 'nota_no') { $post_op_marginal_t = "NO"; } if ($post_am_pm == 'AM'){ $post_am_pm_t = 1; } if ($post_am_pm == 'PM'){ $post_am_pm_t = 2; } $post_fecha_t = "$aniox-$mesx-$diax"; $post_fecha_nac = "$post_year-$post_mes-$post_dia"; if ($post_sexo=="MASCULINO") { $post_sexo_t = 1; } else { $post_sexo_t = 2; } if ($_POST['ano'] <> "" and $_POST['numero'] <> "" and $_POST['folio'] <> "" and $_POST['fecha'] <> "" and $_POST['nombre_nino'] <> "" and $_POST['sexo'] <> "" and $_POST['dia'] <> "" and $_POST['mes'] <> "" and $_POST['year'] <> "" and $_POST['nacido'] <> "" and $_POST['hora'] <> "" and $_POST['minutos'] <> "" and $_POST['am_pm'] <> "" and $_POST['lugar_nino'] <> "" and $_POST['municipio_nino'] <> "" and $_POST['estado_nino'] <> "" and $_POST['nombre_testigo1'] <> "" and $_POST['cedula_testigo1'] <> "" and $_POST['nombre_testigo2'] <> "" and $_POST['cedula_testigo2'] <> "" and $_POST['nombre_madre'] <> "" and $_POST['cedula_madre'] <> "" and $_POST['edad_madre'] <> "" and $_POST['nacionalidad_madre'] <> "" and $_POST['civil_madre'] <> "" and $_POST['prof_madre'] <> "" and $_POST['domicilio_madre'] <> "" and $_POST['lugar_madre'] <> "" and $_POST['municipio_madre'] <> "" and $_POST['estado_madre'] <> "" and $_POST['nombre_padre'] <> "" and $_POST['cedula_padre'] <> "" and $_POST['edad_padre'] <> "" and $_POST['nacionalidad_padre'] <> "" and $_POST['civil_padre'] <> "" and $_POST['prof_padre'] <> "" and $_POST['domicilio_padre'] <> "" and $_POST['lugar_padre'] <> "" and $_POST['municipio_padre'] <> "" and $_POST['estado_padre'] <> "" and $_POST['rad_presentacion'] <> "" and $_POST['nombre_otro'] <> "" and $_POST['cedula_otro'] <> "" and $_POST['edad_otro'] <> "" and $_POST['nacionalidad_otro'] <> "" and $_POST['civil_otro'] <> "" and $_POST['prof_otro'] <> "" and $_POST['parentesco'] <> "" and $_POST['domicilio_otro'] <> "" and $_POST['lugar_otro'] <> "" and $_POST['municipio_otro'] <> "" and $_POST['estado_otro'] <> "" and $_POST['nota_marginal'] <> "") { $consulta="insert into nacimientos values('$post_ano','$post_numero','$post_fecha_t','$post_folio','$post_aut','$post_cargo','$post_cedula_aut','$post_nombre_madre',$post_edad_madre,'$post_nacionalidad_madre','$post_civil_madre','$post_cedula_madre','$post_prof_madre','$post_domicilio_madre','$post_lugar_madre','$post_municipio_madre','$post_estado_madre','$post_pre_madre','$post_nombre_padre','$post_edad_padre','$post_nacionalidad_padre','$post_civil_padre','$post_cedula_padre','$post_prof_padre','$post_domicilio_padre','$post_lugar_padre','$post_municipio_padre','$post_estado_padre','$post_pre_padre','$post_nombre_nino','$post_sexo_t','$post_fecha_nac','$post_nacido','$post_hora,$post_minutos','$post_am_pm_t','$post_lugar_nino','$post_municipio_nino','$post_estado_nino','$post_legitimo','$post_cedula_testigo1,'$post_nombre_testigo1','$post_cedula_testigo2','$post_nombre_testigo2','$post_nombre_otro','$post_cedula_otro','$post_edad_otro','$post_nacionalidad_otro','$post_civil_otro','$post_prof_otro','$post_parentesco','$post_domicilio_otro','$post_lugar_otro','$post_municipio_otro','$post_estado_otro','$post_op_marginal_t','$post_nota_marginal','$post_usuario');"; <form action="registrar_nacimiento.php" name="formul" method="post"> <?php ?>
aqui la tabla de la bd
Código SQL:
Ver original
-- CREATE TABLE IF NOT EXISTS `nacimientos` ( `ano` INT(11) NOT NULL, `numero` INT(11) NOT NULL, `fecha` DATE NOT NULL, `folio` VARCHAR(20) NOT NULL, `autoridad` VARCHAR(60) NOT NULL, `cargo_autoridad` VARCHAR(60) NOT NULL, `cedula_autoridad` INT(11) NOT NULL, `nombre_madre` VARCHAR(60) NOT NULL, `edad_madre` INT(11) NOT NULL, `nacionalidad_madre` VARCHAR(20) NOT NULL, `civil_madre` VARCHAR(15) NOT NULL, `cedula_madre` INT(11) NOT NULL, `prof_madre` VARCHAR(100) NOT NULL, `domicilio_madre` VARCHAR(300) NOT NULL, `ciudad_madre` VARCHAR(30) NOT NULL, `municipio_madre` VARCHAR(20) NOT NULL, `estado_madre` VARCHAR(20) NOT NULL, `presenta_madre` INT(11) NOT NULL, `nombre_padre` VARCHAR(60) NOT NULL, `edad_padre` INT(11) NOT NULL, `nacionalidad_padre` VARCHAR(20) NOT NULL, `civil_padre` VARCHAR(15) NOT NULL, `cedula_padre` INT(11) NOT NULL, `prof_padre` VARCHAR(100) NOT NULL, `domicilio_padre` VARCHAR(300) NOT NULL, `ciudad_padre` VARCHAR(30) NOT NULL, `municipio_padre` VARCHAR(20) NOT NULL, `estado_padre` VARCHAR(20) NOT NULL, `presenta_padre` INT(11) NOT NULL, `nombre_nino` VARCHAR(60) NOT NULL, `sexo_nino` INT(11) NOT NULL, `fecha_nino` DATE NOT NULL, `hospital` VARCHAR(100) NOT NULL, `hora` INT(11) NOT NULL, `minuto` INT(11) NOT NULL, `am_pm` INT(11) NOT NULL, `ciudad_nino` VARCHAR(30) NOT NULL, `municipio_nino` VARCHAR(20) NOT NULL, `estado_nino` VARCHAR(20) NOT NULL, `legitimo` VARCHAR(2) NOT NULL, `cedula_testigo1` INT(11) NOT NULL, `nombre_testigo1` VARCHAR(60) NOT NULL, `cedula_testigo2` INT(11) NOT NULL, `nombre_testigo2` VARCHAR(60) NOT NULL, `nombre_otro` VARCHAR(60) NOT NULL, `cedula_otro` INT(11) NOT NULL, `edad_otro` INT(11) NOT NULL, `nacionalidad_otro` VARCHAR(20) NOT NULL, `civil_otro` VARCHAR(15) NOT NULL, `prof_otro` VARCHAR(100) NOT NULL, `parentesco` VARCHAR(30) NOT NULL, `domicilio_otro` VARCHAR(200) NOT NULL, `ciudad_otro` VARCHAR(30) NOT NULL, `municipio_otro` VARCHAR(20) NOT NULL, `estado_otro` VARCHAR(20) NOT NULL, `op_marginal` VARCHAR(2) NOT NULL, `nota_marginal` text NOT NULL, `usuario` VARCHAR(20) NOT NULL
de ante mano gracias por su ayuda..
madre de dios nunca habia visto una tabla con tantos datos .. pero ayuda te arroja algun error .. la conexion te la esta tomando .. o pasa dice que registra y no lo hace . rutea el codigo debajo del insert tira un linea 138
suerte 


