Chris13
11-29-2006, 03:14 AM
My MySQL version is 5.0. I am trying to run this small query but getting this SQL error
"Error! Could not insert valuesYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''userdata' ('fName', 'lName', 'email', 'confEmail', 'password', 'confirmPassword' at line 1"
The syntax that I am working on is:
$sql = "insert data 'userdata' ('fName', 'lName', 'email', 'confEmail', 'password', 'confirmPassword', 'address', 'city', 'state', 'postCode', 'gender', 'profession', 'ageGroup', 'mallPref', 'mailConsent') VALUES ($fName, $lName, $email, $confEmail, $password, $confirmPassword, $address, $city, $state, $postCode, $gender, $profession, $ageGroup, $mallPref, $mailConsent)";
dont understand where is it wrong. Does capitalization of INSERT also matters. I am new to this. Please advice.
Thanks in advance.
Chris
"Error! Could not insert valuesYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''userdata' ('fName', 'lName', 'email', 'confEmail', 'password', 'confirmPassword' at line 1"
The syntax that I am working on is:
$sql = "insert data 'userdata' ('fName', 'lName', 'email', 'confEmail', 'password', 'confirmPassword', 'address', 'city', 'state', 'postCode', 'gender', 'profession', 'ageGroup', 'mallPref', 'mailConsent') VALUES ($fName, $lName, $email, $confEmail, $password, $confirmPassword, $address, $city, $state, $postCode, $gender, $profession, $ageGroup, $mallPref, $mailConsent)";
dont understand where is it wrong. Does capitalization of INSERT also matters. I am new to this. Please advice.
Thanks in advance.
Chris