Ver Mensaje Individual
  #8 (permalink)  
Antiguo 04/09/2011, 11:37
basket92
(Desactivado)
 
Fecha de Ingreso: abril-2009
Mensajes: 47
Antigüedad: 15 años
Puntos: 0
Respuesta: gestion de tablas en la bd

Hola, lo he configurado de la siguiente manera en la base de datos

http://img66.xooimage.com/files/f/4/8/bd-2c859c5.png

Ahora adjunto el formulario

form.html

<form action="guardar.php" method="post" enctype="multipart/form-data">
<p>Nombre :
<label for="textfield"></label>
<label for="textfield3"></label>
<label for="textfield4"></label>
<input type="text" name="name" id="name">
</p>
<p>Apellido :
<label for="textfield2"></label>
<label for="textfield2"></label>
<label for="textfield5"></label>
<input type="text" name="surname" id="surname">
</p>
<p>
<input type="submit" name="button" id="button" value="Enviar">
</p>
</form>

Como hago para hacer la selección?

guardar.php

<?php
$sitio="localhost";
$usuario="admin";
$pass="hermanos2";
$base="franq";
$name=$_POST["name"];
$surname=$_POST["surname"];
$date=$_POST["date"];
$con=mysql_connect($sitio,$usuario,$pass);
if(mysql_select_db($base,$con)){
$consulta ="insert into juniormasc values ('$name','$surname','$date')";
if(mysql_query($consulta,$con))
{
echo "El usuario ha sido registrado correctamente";
}
else

{
echo mysql_error($con);
}
}
else
{
echo mysql_error($con);
}
?>

Última edición por basket92; 04/09/2011 a las 11:46