24/04/2002, 10:23
|
| | Fecha de Ingreso: julio-2001
Mensajes: 278
Antigüedad: 23 años, 6 meses Puntos: 0 | |
Re: introducir datos en BD mysql Previamente hay ke generar una base de datos, para este ejemplo yo la llame "prueba" y generé la tabla "persona", con los campos nombre, apellidos y edad . pagina.html
<html>
<body>
<form action="datos.php" method="Post">
Nombre: <input type="text" name="nom_f"><br>
Apellidos: <input type="text" name="ap_f"><br>
Edad: <input type="text" name="edad_f"><br>
</form>
</body>
</html> datos.php
<html>
<body>
<?
$conn = mysql_connect("localhost");
mysql_select_db("prueba"); //o Como se llame
mysql_query("INSERT INTO persona(nombre, apellidos, edad) VALUES('$nom_f','$ap_f',$edad_f)");
mysql_close($conn);
?>
</body>
</html>
<a href="http://www.ansiwebs.com"><img border="0" src="http://www.ansiwebs.com/img/agarciaa.jpg"></a> |