Es gibt wohl einen Bug in php @PDO::beginTransaction() and PDO::commit()
ist aber noch nicht offiziell.
Wenn ihr PDO::beginTransaction() and PDO::commit() nutzt
dann schreibt keine Kommentare (-- comment ...) nach dem ; (Semikolon) der SQL-Query.
Multi-Queries sind wohl nicht erlaubt/vorgesehen bei PDO.
Heißt: "INSERT INTO ...; INSERT INTO ...; INSERT INTO ...;" darf/geht nicht.
Es wird sicherlich mit ner regexp der übergebene String behandelt und dabei geht "was durcheinander".
Denn auch Kommentare nach dem ; (Semikolon) sorgen dafür, dass die Daten nicht beim Sql-Server ankommen.
SQL
$sql = "
-- this is my pretty commented query ...
-- above comments works
INSERT INTO
`testdb`.`tbl`
SET
`name` = 'a' -- middle comment works
-- `name` = 'a' middle new line comments works
; -- but this comment finally f* it up
-- so simple nothing is allowed after the ;
-- except if we destroy the stmt
";
Alles anzeigen
Der Bugreport: https://bugs.php.net/bug.php?id=66621
Also Kommentare immer schön in der Query schreiben. Nicht nach dem ;
=)