![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
11/09/2014, 16:55
|
![Avatar de nicoruiztucuman](http://static.forosdelweb.com/customavatars/avatar555284_1.gif) | | | Fecha de Ingreso: septiembre-2014
Mensajes: 7
Antigüedad: 10 años, 5 meses Puntos: 0 | |
Respuesta: Agregar cliente a la base de datos mediante php
Código:
<?php
/* aquí va a ir el código necesario para insertar el cliente */
include "conexion.php";
$nombre=$_POST['nombre'];
$dni=$_POST['dni'];
$fecha=$_POST['fecha'];
$facebook=$_POST['fb'];
$celular=$_POST['cel'];
$codigo_para_insertar="INSERT INTO Clientes(nombre,facebook) VALUES('$nombre','$dni','$fecha','$facebook','$cel')";
$db=crearConexion(); //esta línea me faltó antes
$db->query($codigo_para_insertar);
$db->close();
echo($codigo_para insertar);
?>
<html>
<head>
<title>Registro completado</title>
</head>
<body>
<div>Se registró el cliente OK</div>
<a href="index.html">Volver a index.html</a>
</body>
</html>
|