Создать базу данных, используя эту структуру:
CREATE TABLE stackoverflow
. members
(id
INT NOT NULL AUTO_INCREMENT PRIMARY KEY, username
VARCHAR (30) NOT NULL, firstname
VARCHAR (30) NOT NULL, lastname
VARCHAR (30) NOT NULL, email
VARCHAR (100) NOT NULL, location
VARCHAR (30) NOT NULL, expertise
VARCHAR (30) NOT NULL) ДВИГАТЕЛЬ = MYISAM;
и update.php:
<?php
$username = $_POST['id'];
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$email = $_POST['email'];
$location = $_POST['location'];
$expertise = $_POST['expertise'];
mysql_connect ("localhost", "root", "yourpassword") or die(mysql_error());
mysql_select_db ("stackoverflow");
$query="INSERT INTO members (id,username, firstname, lastname, email, location, expertise) VALUES ('','$username', '$firstname', '$lastname', '$email', '$location', '$expertise')";
mysql_query($query) or die (mysql_error());
echo "Database Updated With: " .$username. " , " .$firstname. " , ".$lastname. " , ".$email. " , " .$location. " , " .$expertise ;
?>
Не копируйте и не вставляйте его в свой файл .. Просто попытайтесь понять это ..