Forum Moderators: open
I just can't get my head round this.
I am using phpMyAdmin to set up and manage a database, but I'm having real problems, trying to INSERT data into a table through the SQL windows.
Now here's the strange part - if I type the data directly into the sql window it runs the query fine and adds the data to the table. However, if I paste the data from another file in exactly the same format it comes up with a syntax error?
#1064 - 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 'Africa’, ‘20mm’, 258.5, 49.5),(NULL, ‘Nero Africa’, ‘30mm’, 291.5,' at line 1
If I use the MySQL prompt, it works fine too, but I can't copy and paste to this. I am 99.99999% certain there is nothing wrong with the syntax.
I could input all by hand but that would take forever. Please help before I am forced to get a paper round.
Thanks
Mark
#1064 - 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 'Africa’, ‘20mm’, 258.5, 49.5),
(NULL, ‘Nero Africa’, ‘30mm’, 291.' at line 2
I'm having real problems, trying to INSERT data ... it comes up with a syntax error
#1064 - You have an error in your SQL syntax;
"Error: 1064 SQLSTATE: 42000 (ER_PARSE_ERROR)"
So, you have a simple parse-error, and I reckon that I know what it is:
#1064 ... an error in your SQL syntax; check ... near 'Africa’, ‘20mm’, 258.5, 49.5),
(NULL, ‘Nero Africa’, ‘30mm’, 291.' at line 2
(NULL, "Africa", "20mm", 258.5, 49.5)
(NULL, ‘Africa’, ‘20mm’, 258.5, 49.5)
****************************************
Your problem is MS Word Smart Quotes
****************************************
Word will take `"Africa"`
and turn it into `‘Africa’`
(default action). For some reason, MySQL will not recognise Smart Quotes as valid text delimiters (I don't know why).
What you need to do is to dig into your Word manual, and discover how to turn Smart Quotes off, re-save the info in that state, and re-paste from the new file.
[edited by: AlexK at 6:17 am (utc) on Feb. 19, 2007]