|
Posted by Tom on 09/26/43 11:37
I've used heredocs for single SQL statements without a problem. Also,
I've tried this using the SQL form on PhpMyAdmin and it works so I
conclude it should work in PHP.
Problem: getting syntax error with following SQL statement:
$_sql = <<<SQLDOC
LOCK TABLES `table_name` WRITE;
INSERT INTO `table_name` ('col_a', 'col_b') VALUES ('value_a1',
'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?
Thanks in advance,
Tom
Navigation:
[Reply to this message]
|