Problemas al registrar datos
Publicado por Mord (5 intervenciones) el 05/01/2015 13:55:43
Saludos a todos. Tengo un formulario que me pide los datos de una persona, para posteriormente enviarlos a una base de datos hecha en Xampp, pero al momento de guardar los datos me aparece un error:
"Problemas en el selectYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '','','')' at line 1"
Me ayudan por favor?
Copio los codigos:
html
insert.php
"Problemas en el selectYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '','','')' at line 1"
Me ayudan por favor?
Copio los codigos:
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<html>
<head>
<title>Registrar </title>
</head>
<body>
<h1 align="center"><em>Registrar</em></h1>
<form action="insert.php" method="post">
<div align="center">
<p>Ingrese cedula:
<input type="text" name="cedula"><br>
Ingrese nombre: <input type="text" name="nombre"><br>
Ingrese apellido: <input type="text" name="apellido"><br>
<br>
<input type="submit" value="Registrar">
</p>
</div>
</form>
</body>
</html>
insert.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<html>
<head>
<title>Ingresar</title>
</head>
<body>
<?php
$conexion = mysql_connect("localhost", "root", "") or die("Problemas en la conexion");
mysql_select_db("personas", $conexion) or die("Problemas en la seleccion de la base de datos");
mysql_query("insert into datos(cedula,apellidos,nombres) values ('$_REQUEST[cedula]','$_REQUEST[apellidos]','$_REQUEST[nombres]')",$conexion) or die("Problemas en el select" . mysql_error());
mysql_close($conexion);
echo "El obrero fue registrado.";
?>
</body>
</html>
Valora esta pregunta
0