Ver Mensaje Individual
  #6 (permalink)  
Antiguo 21/03/2014, 07:30
keivis
 
Fecha de Ingreso: julio-2013
Mensajes: 123
Antigüedad: 10 años, 9 meses
Puntos: 1
Respuesta: sos con registro a base de datos no registra

Hola bien si están en lo cierto no aclare con precisión el problema. como tal no me manda ningún error solo que los datos no se almacenan. trate de modificar algunos datos y en fecto almacena la información pero no como debería.

tratare de colgar el código en varias entradas a ver si pueden ayudarme.

parte I

Código PHP:
Ver original
  1. <body>
  2. <?php
  3. include ("config.php");
  4. $con=mysql_connect($host,$user,$pass);
  5. if (!$con) {
  6. die('Problemas con el servidor: ' . mysql_error());
  7. }
  8. $db_selected = mysql_select_db($db,$con);
  9. if (!$db_selected) {
  10. die ('Error al conectar a la BD. : ' . mysql_error());
  11. }
  12. if (isset($_POST['guardar'])) {
  13.  
  14. $post_ano = $_POST['ano'];
  15. $post_numero = $_POST['numero'];
  16. $post_folio = $_POST['folio'];
  17. $post_fecha = $_POST['fecha'];
  18.  
  19. $post_aut = $_POST['nombre_aut'];
  20. $post_cargo = $_POST['cargo'];
  21. $post_cedula_aut = $_POST['cedula_aut'];
  22.  
  23. $post_nombre_nino = strtoupper($_POST['nombre_nino']);
  24. $post_sexo = $_POST['sexo'];
  25. $post_dia = $_POST['dia'];
  26. $post_mes = $_POST['mes'];
  27. $post_year = $_POST['year'];
  28. $post_nacido = strtoupper($_POST['nacido']);
  29. $post_hora = $_POST['hora'];
  30. $post_minutos = $_POST['minutos'];
  31. $post_am_pm = $_POST['am_pm'];
  32. $post_lugar_nino = strtoupper($_POST['lugar_nino']);
  33. $post_municipio_nino = strtoupper($_POST['municipio_nino']);
  34. $post_estado_nino = strtoupper($_POST['estado_nino']);
  35. $post_legitimo = strtoupper($_POST['legitimo']);
  36.  
  37. $post_nombre_testigo1 = strtoupper($_POST['nombre_testigo1']);
  38. $post_cedula_testigo1 = $_POST['cedula_testigo1'];
  39. $post_nombre_testigo2 = strtoupper($_POST['nombre_testigo2']);
  40. $post_cedula_testigo2 = $_POST['cedula_testigo2'];
  41.  
  42. $post_nombre_madre = strtoupper($_POST['nombre_madre']);
  43. $post_cedula_madre = $_POST['cedula_madre'];
  44. $post_edad_madre = $_POST['edad_madre'];
  45. $post_nacionalidad_madre = $_POST['nacionalidad_madre'];
  46. $post_civil_madre = $_POST['civil_madre'];
  47. $post_prof_madre = strtoupper($_POST['prof_madre']);
  48. $post_domicilio_madre = strtoupper($_POST['domicilio_madre']);
  49. $post_lugar_madre = strtoupper($_POST['lugar_madre']);
  50. $post_municipio_madre = strtoupper($_POST['municipio_madre']);
  51. $post_estado_madre = strtoupper($_POST['estado_madre']);
  52.  
  53. $post_nombre_padre = strtoupper($_POST['nombre_padre']);
  54. $post_cedula_padre = $_POST['cedula_padre'];
  55. $post_edad_padre = $_POST['edad_padre'];
  56. $post_nacionalidad_padre = $_POST['nacionalidad_padre'];
  57. $post_civil_padre = $_POST['civil_padre'];
  58. $post_prof_padre = strtoupper($_POST['prof_padre']);
  59. $post_domicilio_padre = strtoupper($_POST['domicilio_padre']);
  60. $post_lugar_padre = strtoupper($_POST['lugar_padre']);
  61. $post_municipio_padre = strtoupper($_POST['municipio_padre']);
  62. $post_estado_padre = strtoupper($_POST['estado_padre']);
  63.  
  64. $post_nombre_otro = strtoupper($_POST['nombre_otro']);
  65. $post_cedula_otro = $_POST['cedula_otro'];
  66. $post_edad_otro = $_POST['edad_otro'];
  67. $post_nacionalidad_otro = $_POST['nacionalidad_otro'];
  68. $post_civil_otro = $_POST['civil_otro'];
  69. $post_prof_otro = strtoupper($_POST['prof_otro']);
  70. $post_parentesco = strtoupper($_POST['parentesco']);
  71. $post_domicilio_otro = strtoupper($_POST['domicilio_otro']);
  72. $post_lugar_otro = strtoupper($_POST['lugar_otro']);
  73. $post_municipio_otro = strtoupper($_POST['municipio_otro']);
  74. $post_estado_otro = strtoupper($_POST['estado_otro']);
  75.  
  76. $post_usuario = $_SESSION['username'];
  77.  
  78.  
  79. $post_presentacion = $_POST['rad_presentacion'];
  80. if ($post_presentacion == 'rad_padre') {
  81.  $post_pre_padre = 1;
  82.  $post_pre_madre = 0;
  83.  $post_pre_otro = 0;
  84. }
  85.  
  86. if ($post_presentacion == 'rad_madre') {
  87.  $post_pre_padre = 0;
  88.  $post_pre_madre = 1;
  89.  $post_pre_otro = 0;
  90. }
  91.  
  92. if ($post_presentacion == 'rad_otro') {
  93.  $post_pre_padre = 0;
  94.  $post_pre_madre = 0;
  95.  $post_pre_otro = 1;
  96. }
  97.  
  98. $post_op_marginal = $_POST['rad_marginal'];
  99. $post_nota_marginal = strtoupper($_POST['nota_marginal']);
  100. if ($post_op_marginal == 'nota_si') {
  101.  $post_op_marginal_t = "SI";
  102. }
  103. if ($post_op_marginal == 'nota_no') {
  104.  $post_op_marginal_t = "NO";
  105. }
  106.  
  107. if ($post_am_pm == 'AM'){
  108.    $post_am_pm_t = 1;
  109. }
  110. if ($post_am_pm == 'PM'){
  111.    $post_am_pm_t = 2;
  112. }
  113. list($diax,$mesx,$aniox)=explode("-",$post_fecha);
  114. $post_fecha_t = "$aniox-$mesx-$diax";
  115.  
  116. $post_fecha_nac = "$post_year-$post_mes-$post_dia";
  117.  
  118. if ($post_sexo=="MASCULINO") {
  119.     $post_sexo_t = 1;
  120.     } else {
  121.     $post_sexo_t = 2;
  122. }
  123.  
  124. 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'] <> "") {
  125.  
  126.  
  127. $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');";
  128. $query = mysql_query($consulta); mysql_close($con); }}?>