I keep getting an undefined index error. I thought my INSERT statement would take care of that but nothing I am trying works. I've tried the EXTRACT ($_POST) method, and naming each individual variable, but still the same error.....
<?php
$Customer_Lname=$_POST['lastname'];
$Customer_Fname=$_POST['firstname'];
$Customer_address=$_POST['address'];
$Customer_city=$_POST['city'];
$Customer_state=$_POST['state'];
$Customer_zipcode=$_POST['zipcode'];
$Customer_email=$_POST['email'];
$Customer_username=$_POST['username'];
$Customer_password=$_POST['password'];
// open connection to database
$db = mysql_connect("localhost", "root", "");
if (!$db)
{
print "unable to connect!";
exit;
}
//select database to use
$db= mysql_select_db ("mapleside");
if (!$db)
{
print "could not select database";
exit;
}
// create SQL query string
$query = "INSERT INTO customer (Customer_Lname, Customer_Fname, Customer_address, Customer_city, Customer_state, Customer_zipcode, Customer_email, Customer_username, Customer_password) VALUES ($Customer_Lname, $Customer_Fname, $Customer_address, $Customer_city, $Customer_state, $Customer_zipcode, $Customer_email, $Customer_username , $Customer_password)";
$result = mysql_query($query);
mysql_query($query) or die
('Error, insert query failed');
echo('Data inserted successfully' );
//close connection
mysql_close();
// This will have to be adjusted once the pages are completed.
?>
By the way, thanks to all who helped me with my forms. They are up and working now! I appreciate it!