I am having trouble inserting users into a mysql database
This is the error I am getting:
Array ( ) Error Column count doesn't match value count at row 1 :
Column count doesn't match value count at row 1
This is the Query:
$query = "INSERT INTO customer (cust_id, surname,
firstname,title,address1, address2, city, state, zipcode,
country, phone, fax, email, birth_date)
VALUES (NULL, " .
"\"" . $formVars["surname"] . "\", " .
"\"" . $formVars["firstName"] . "\", " .
"\"" . $formVars["title"] . "\", " .
"\"" . $formVars["address1"] . "\", " .
"\"" . $formVars["address2"] . "\", " .
"\"" . $formVars["city"] . "\", " .
"\"" . $formVars["state"] . "\", " .
"\"" . $formVars["zipcode"] . "\", " .
"\"" . $formVars["country"] . "\", " .
"\"" . $formVars["phone"] . "\", " .
"\"" . $formVars["fax"] . "\", " .
"\"" . $formVars["email"] . "\", " .
$dob . ", " .
0 . ")";
This is the Table structure for table 'customer':
CREATE TABLE customer (
cust_id int(5) NOT NULL auto_increment,
surname varchar(50) NOT NULL,
firstname varchar(50) NOT NULL,
title varchar(10),
address1 varchar(50) NOT NULL,
address2 varchar(50) NOT NULL,
city varchar(20) NOT NULL,
state varchar(20) NOT NULL,
zipcode varchar(5) NOT NULL,
country varchar(30) NOT NULL,
phone varchar(15) NOT NULL,
fax varchar(20),
email varchar(50) NOT NULL,
birth_date date NOT NULL,
PRIMARY KEY (cust_id),
KEY names (surname, firstname, zipcode)
);
How come i am still getting an error stating the column's and the values don't match if i list the columns in the $query???
😕
Please Help In anyway you can, Thank-you