MySQL Forums
Forum List  »  Newbie

What is wrong with my SQL syntax?
Posted by: Luke O'Brien
Date: May 26, 2012 11:00AM

Hello All,

Normally I am okay with syntax, but for the life of me I can't se anything wrong in this statement, so I am going to post it here, along with the mysql_error().

INSERT INTO ct_staff (First_name, Last_name, Initials, Title, Address_line_1, Address_line_2, Address_line_3, Address_line_4, Post_town, Post_code, Telephone, Fax, Email, Mobile, Archived, Region_ID) VALUES ('*', '*****-*****', '***', 'Mr', '*****', NULL, NULL, NULL, '******', '*******', '***** *****', '****** ******', '******@*******.org.uk', '****** *****', 0, 0)

Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'*\', \'****-******\', \'***\', \'Mr\', \'*********\', NULL, NULL, N' at line 1

I am doing this database for a local charity, so I have replaced sensitive values with ***, but I have kept the format the same for each (in case that helps).

All the columns are VARCHAR(50), except Archived = BIT(1) and Region_ID = INT(11), but then that would be a diffrent error, not syntax.

I am using PHP implode to create the statement, and this is is part of a function to import CSV values, I can show the PHP code if that helps.

The statement itself looks fine to me, and I have no idea as to what is wrong.
Any help is much appreciated.

Luke



Edited 1 time(s). Last edit at 05/26/2012 02:49PM by Luke O'Brien.

Options: ReplyQuote


Subject
Written By
Posted
What is wrong with my SQL syntax?
May 26, 2012 11:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.