jacksondorado
IS-IT--Management
Hi,
My webpage form submits and emails the data no problem but the data does not write to the table in the database. I can't figure our why. I used a textbook example that works for me and just changed the variables. Any help would be appreciated.
Here is the code piece of code that is supposed to write to the table:
//////////////////////////////////////////////////////////
$dbh=mysql_connect ("localhost", "user", "password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("$database");
$connection = mysql_connect($host,$user,$password) or die ("Couldn't connect to server.");
$db = mysql_select_db($database, $connection)
or die ("Couldn't select database.");
$sql = "INSERT INTO table (a1001_date_of_your_visit,
a1002_time_of_visit,
a1003_server_name,
a1004_restaurant,
a1005_recommend_to_others,
a1006_dined_at_before,
a1007_host_greeting,
a1008_food_quality_appeal,
a1009_server_experience,
a1010_ambiance_environment,
a1011_beverages,
a1012_price_value,
a1013_comments,
a1014_first_name,
a1015_last_name,
a1016_phone_number,
a1017_best_time_to_reach_me,
a1018_email,
a1019_street_line_1,
a1020_street_line_2,
a1021_city,
a1022_state,
a1023_zip_code) VALUES
('$z1001_date_of_your_visit',
('$z1001_date_of_your_visit',
('$z1002_time_of_visit',
('$z1003_server_name',
('$z1004_restaurant',
('$z1005_recommend_to_others',
('$z1006_dined_at_before',
('$z1007_host_greeting',
('$z1008_food_quality_appeal',
('$z1009_server_experience',
('$z1010_ambiance_environment',
('$z1011_beverages',
('$z1012_price_value',
('$z1013_comments',
('$z1014_first_name',
('$z1015_last_name',
('$z1016_phone_number',
('$z1017_best_time_to_reach_me',
('$z1018_email',
('$z1019_street_line_1',
('$z1020_street_line_2',
('$z1021_city',
('$z1022_state',
('$z1023_zip_code')";
My webpage form submits and emails the data no problem but the data does not write to the table in the database. I can't figure our why. I used a textbook example that works for me and just changed the variables. Any help would be appreciated.
Here is the code piece of code that is supposed to write to the table:
//////////////////////////////////////////////////////////
$dbh=mysql_connect ("localhost", "user", "password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("$database");
$connection = mysql_connect($host,$user,$password) or die ("Couldn't connect to server.");
$db = mysql_select_db($database, $connection)
or die ("Couldn't select database.");
$sql = "INSERT INTO table (a1001_date_of_your_visit,
a1002_time_of_visit,
a1003_server_name,
a1004_restaurant,
a1005_recommend_to_others,
a1006_dined_at_before,
a1007_host_greeting,
a1008_food_quality_appeal,
a1009_server_experience,
a1010_ambiance_environment,
a1011_beverages,
a1012_price_value,
a1013_comments,
a1014_first_name,
a1015_last_name,
a1016_phone_number,
a1017_best_time_to_reach_me,
a1018_email,
a1019_street_line_1,
a1020_street_line_2,
a1021_city,
a1022_state,
a1023_zip_code) VALUES
('$z1001_date_of_your_visit',
('$z1001_date_of_your_visit',
('$z1002_time_of_visit',
('$z1003_server_name',
('$z1004_restaurant',
('$z1005_recommend_to_others',
('$z1006_dined_at_before',
('$z1007_host_greeting',
('$z1008_food_quality_appeal',
('$z1009_server_experience',
('$z1010_ambiance_environment',
('$z1011_beverages',
('$z1012_price_value',
('$z1013_comments',
('$z1014_first_name',
('$z1015_last_name',
('$z1016_phone_number',
('$z1017_best_time_to_reach_me',
('$z1018_email',
('$z1019_street_line_1',
('$z1020_street_line_2',
('$z1021_city',
('$z1022_state',
('$z1023_zip_code')";