MySQL Insert Query Issue? Hi,
I have a problem inserting some data into a table in my database.
It seems to register that I am trying to put some data in, because it creates a new field and increments it by one.
However, it does not insert any data into the fields I have asked it to. Could anyone fix this insert query?
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
//Define Variables
$email = clean($HTTP_POST_VARS['Email1']);
$firstname = clean($HTTP_POST_VARS['FirstName']);
$lastname = clean($HTTP_POST_VARS['LastName']);
$passone = clean($HTTP_POST_VARS['Password1']);
$passtwo = clean($HTTP_POST_VARS['Password2']);
$newsletter = clean($HTTP_POST_VARS['Newsletter']);
//Insert into Customers Table
$insert = "insert into " . $tbl_name . " (`customers_firstname`, `customers_lastname`, `customers_email_address`, `customers_username`, `customers_password`, `customers_newsletter`) values ('" .$email. "', '" .$firstname. "', '" .$lastname. "', '" .$passone. "', '" .$passtwo. "', '" .$newsletter. "')";
$accountinsert = mysql_query($insert);
Many thanks |