|
New to the CF scene
Join Date: Apr 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
Unknown column 'FirstName' in 'field list'
I'm new to PHP and MYSQL. I am struggling with an error - Unknown column 'FirstName' in 'field list'. I have a form that I want to add the fields into a new table tbl_refrigerated_wine_cabinet_request. I've verified the spelling of the column names in the new table. Following is a snippet of the code. Thanks for your help!
[CODE]
$refrigerated_wine_cabinet_request_table = 'tbl_refrigerated_wine_cabinet_request';
if ($_POST) {
$mysql_data = " (FirstName, LastName, Email, Phone, ContactPreference, CabinetType, CabinetQty, Cabinet1HandleLocation, Cabinet2HandleLocation, Cabinet3HandleLocation, Cabinet4HandleLocation, BuiltIn, FinishedEnds, Size, Shelves, HardwareStyle, CabinetFinish, HardwareColor, LEDQty, CenterEtchingQty, BorderEtchingQty, ArchedDoorEtchingQty, WoodSpecies, Stain, Other, UserAgent, IPAddress, HTTPReferer, TimeStamp, EmailOptIn )
VALUES
('$first_name', '$last_name', '$email', '$phone', '$contactpref', '$cabinet_type','$cabinet_quanitity', '$handle_location1', '$handle_location2', '$handle_location3', '$handle_location4', '$built', '$finished_ends' , '$size', '$shelves', '$hardware_style', '$finish', '$hardware_color', '$led_qty', '$center_etching_qty', '$border_etching_qty', '$arched_door_glass_qty', '$wood_species', '$stain', '$other', '$user_agent' , '$IP_Address', '$Referer', '$time_stamp', '$email_optin')
";
// insert into the table used for email opt-in processing.
$insert_sql = "INSERT INTO $refrigerated_wine_cabinet_request_table ".$mysql_data;
$status = $db->query($insert_sql);
if (!$status)
error_log("sql error request, sql: INSERT INTO $refrigerated_wine_cabinet_request_table ".$mysql_data);
[CODE]
|
|