I'm trying to make the following transaction work, but the I get a mysql error near SELECT. I've double-checked that all column names are correct.
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 articles (catid,content,title,keywords,isactive) (SELEC' at line 2
SQL
START TRANSACTION;
INSERT INTO articles (catid,content,title,keywords,isactive)
(SELECT 1, pendingarticles.content, pendingarticles.title,
pendingarticles.keywords, 1
FROM pendingarticles
WHERE pendingarticles.id=1);
DELETE FROM pendingarticles WHERE id=1;
COMMIT;
UPDATE
The code itself works. Both the INSERT INTO - SELECT part, and the DELETE part. Something's wrong with the transaction. Perhaps ;
? Or my db server can't do transactions?