Ver Mensaje Individual
  #4 (permalink)  
Antiguo 06/12/2015, 11:01
diegoj9999
 
Fecha de Ingreso: noviembre-2015
Ubicación: NULL
Mensajes: 23
Antigüedad: 8 años, 6 meses
Puntos: 1
Respuesta: alguen me podría ayudar con este error

Prueba así

Código PHP:
Ver original
  1. <?php
  2. if ($_SESSION['autorizar']!="si") {
  3. header("location:index.php?error=1");
  4. }
  5. require_once("conexion.php");
  6. $conexion=conexion();
  7.  
  8. if(!empty($_POST['codigo']) && !empty($_POST['nombre']) && !empty($_POST['Apellido'])
  9. && !empty($_POST['barrio']) && !empty($_POST['ciudad'])
  10. && !empty($_POST['cod_postal'])
  11. && !empty($_POST['fecha_de_nacimiento'])){
  12. $sql_="insert into pacientes(codigo, nombre, Apellido, barrio, ciudad, cod_postal, fecha_de_nacimiento)
  13. values(".$_POST['codigo'].",'{$_POST['nombre']}','{$_POST['Apellido']}',
  14. '{$_POST['barrio']}','{$_POST['barrio']}','{$_POST['ciudad']}',
  15. '{$_POST['cod_postal']}','{$_POST['fecha_de_nacimiento']}') ";
  16. $ejecutar_pacientes=mysqli_query($conexion, $sql_)
  17. or die("el ingreso de datos no se pudo realizar ".mysqli_error($conexion));
  18.  
  19.  
  20. if($ejecutar_pacientes)
  21. header("location:listar_usuarios.php");
  22. else
  23. echo "la sentencia de nuevos usuarios no se a podido ejecutar ".mysqli_error($conexion);
  24.  
  25. }else
  26. echo "por favor ingrese los datos ";
  27.  
  28. ?>