|
Posted by Tim Van Wassenhove on 09/26/18 11:37
On 2006-01-17, Tom <klenwell@gmail.com> wrote:
> 'value_a2');
> INSERT INTO `table_name` ('col_a', 'col_b') VALUES ('value_b1',
> 'value_b2');
> UNLOCK TABLES;
> SQLDOC;
>
> Error Message:
>
> "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 '; INSERT INTO `table_name`..."
>
> The manual didn't help me. I suspect maybe it has something to do with
> the way the semicolon is parsed? What am I missing?
This is obviously a (My)SQL syntax error, thus you need to search in that
manual. Notice that there are no quotes around the column names:
http://dev.mysql.com/doc/refman/5.0/en/insert.html
INSERT INTO table (cola, colb) VALUES ('val1', 'val2');
In case you are using reserverd keywords as a table or column name, you should
use ``` to inform MySQL about that.
INSERT INTO `table` (`cola`) VALUES ('vala');
--
Met vriendelijke groeten,
Tim Van Wassenhove <http://timvw.madoka.be>
Navigation:
[Reply to this message]
|