You are here: Re: using heredoc for SQL statements « PHP Programming Language « IT news, forums, messages
Re: using heredoc for SQL statements

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация