intento ingresar un formulario a una base datos para guardar datos en 4 tablas php y mysql
Publicado por Rey (74 intervenciones) el 02/07/2019 02:52:18
intento ingresar un formulario a una base datos para guardar datos en 4 tablas en php y mysql
index.php
conexion.php
me sale esto errorres en el index
Notice: Array to string conversion index.php on line 85
Notice: Array to string conversion index.php on line 85
Notice: Array to string conversion index.php on line 85
Notice: Array to string conversion index.php on line 85
Notice: Array to string conversion index.php on line 85
Warning: mysqli_query() expects at least 2 parameters, 1 given index.php on line 85
Notice: Array to string conversion index.php on line 88
Warning: mysqli_query() expects at least 2 parameters, 1 given index.php on line 88
Notice: Array to string conversion index.php on line 90
Warning: mysqli_query() expects at least 2 parameters, 1 given index.php on line 90
Notice: Array to string conversion index.php on line 92
Warning: mysqli_query() expects at least 2 parameters, 1 given index.php on line 92
Warning: mysqli_close(): Couldn't fetch mysqli index.php on line 94
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Registro</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../quiz.css" rel="stylesheet" type="text/css">
</head>
<body>
</br>
</br>
</br>
</br>
<h1>Ingreso de vacunas por Primera vez</h1>
<form action="index.php" method="post">
<label for="Primer_nombre">Primer Nombre:</label><input type="text" name="Primer_nombre"/></br></br>
<label for="Segundo_nombre">Segundo Nombre:</label><input type="text" name="Segundo_nombre"/></br></br>
<label for="Primer_Apellido">Primer Apellido:</label><input type="text" name="Primer_apellido"/></br></br>
<label for="Segundo_Apellido">Segundo Apellido:</label><input type="text" name="Segundo_apellido"/></br></br>
<label for="Tipo_documento">Tipo de Documento:</label>
<select name="Tipo_documento">
<option value="Registro Civil">RC</option>
<option value="Cedula">Cedula</option>
<option value="Tarjeta_de_Identidad">Tarjeta de Identidad</option>
</select></br></br></br></br></br></br>
<label for="Numero_documento">Numero de Documento:</label><input type="text" name="Numero_documento"/></br></br>
<label for="Nombre_vacunas">Vacunas:</label>
<select name="Nombre_vacunas">
<option value="Neumococo">Neumococo</option>
<option value="Hepatitis B">Hepatitis B</option>
</select></br></br>
<label for="Nombre_eps">Nombre de la Eps:</label>
<select name="Nombre_eps">
<option value="Nueva_eps">Nueva EPS</option>
<option value="Coomeva">Coomeva</option>
</select></br></br></br>
<label for="Fecha">Ingrese La Fecha de la Vacuna:</label><input type="date" name="Fecha"></br></br>
<input type="submit" name="BtnGuardar" value="Guardar"/>
</form>
<?php
if (isset($_POST['BtnGuardar']))
{
include("conexion.php");
$Primer_nombre=$_POST["Primer_nombre"];
$Segundo_nombre=$_POST["Segundo_nombre"];
$Primer_apellido=$_POST["Primer_apellido"];
$Segundo_apellido=$_POST["Segundo_apellido"];
$Tipo_documento=$_POST["Tipo_documento"];
$Numero_documento=$_POST["Numero_documento"];
//segunda tabla
$Nombre_eps=$_POST["Nombre_eps"];
//tercera tabla
$Nombre_vacunas=$_POST["Nombre_vacunas"];
// cuarta tabla
$Fecha=$_POST["Fecha"];
mysqli_query("INSERT INTO pacientes ('Primer_nombre','Segundo_nombre','Primer_apellido','Segundo_apellido','Tipo_documento','Numero_documento')VALUES('$_POST(Primer_nombre)','$_POST(Segundo_nombre)','$_POST(Primer_apellido)','$_POST(Tipo_documento)','$_POST(Numero_documento)')");
mysqli_query("INSERT INTO eps ('Nombre_eps')VALUES('$_POST(Nombre_eps)')");
mysqli_query("INSERT INTO vacunas ('Nombre_vacunas')VALUES('$_POST(Nombre_vacunas)')");
mysqli_query("INSERT INTO fecha_de_la_vacuna ('Fecha')VALUES('$_POST(Fecha)')");
mysqli_close($con);
echo "Registro Completado.";
}
?>
conexion.php
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
$con = new mysqli("localhost","root","","quimiosalud");
if (mysqli_connect_errno()) {
die("No se puede conectar a la base de datos:" . mysqli_connect_error());
}else{
echo "conexion exitosa";
}
$con->close();
?>
me sale esto errorres en el index
Notice: Array to string conversion index.php on line 85
Notice: Array to string conversion index.php on line 85
Notice: Array to string conversion index.php on line 85
Notice: Array to string conversion index.php on line 85
Notice: Array to string conversion index.php on line 85
Warning: mysqli_query() expects at least 2 parameters, 1 given index.php on line 85
Notice: Array to string conversion index.php on line 88
Warning: mysqli_query() expects at least 2 parameters, 1 given index.php on line 88
Notice: Array to string conversion index.php on line 90
Warning: mysqli_query() expects at least 2 parameters, 1 given index.php on line 90
Notice: Array to string conversion index.php on line 92
Warning: mysqli_query() expects at least 2 parameters, 1 given index.php on line 92
Warning: mysqli_close(): Couldn't fetch mysqli index.php on line 94
Valora esta pregunta


0