Jump to content

[SOLVED] MySQL insert problem


atticus

Recommended Posts

I am getting syntax error for the following code.  I can't seem to find the problem:

 

Error, insert query failedYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order (cust_id, last_name, first_name, middle_name, suffix, address_1, address_2' at line 1

 

$query = "INSERT INTO order (cust_id, last_name, first_name, middle_name, suffix, address_1, address_2, city, state, zip, gender, race, dob, ssn, search_area_state, search_area_county, city_search, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, type_service, notes) 
VALUES ('$cust_id', '$last_name', '$first_name', '$middle_name', '$suffix', '$address1', '$address2', '$city', '$state', '$zip', '$gender', '$race', '$dob', '$ssn', '$search_area_state', '$search_area_county','$city_search', '$s1', '$s2', '$s3', '$s4', '$s5', '$s6', '$s7', '$s8', '$s9', '$s10', '$s11', '$s12', '$s13', '$s14', '$s15', '$type_service', '$notes');"; 
mysql_query($query) or die('Error, insert query failed' . mysql_error());

 

 

Link to comment
https://forums.phpfreaks.com/topic/82559-solved-mysql-insert-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.