I have the following code:
`START TRANSACTION; UPDATE clients SET invoice_count = @ic := invoice_count + 1 WHERE clients.id = 7;
INSERT INTO invoices (client_invoice_count, grand_totalz) VALUES(( SELECT @ic) ,1208);
SELECT LAST_INSERT_ID(); COMMIT; `
I added a "z" to grand_total so that the second query fails. Since i'm using "START TRANSACTION" auto_commit should be 0 and the update before the insert should not commit to the database.
The problem is that it does commit every single time.
However if I run this exact same command in PHPMYADMIN it works as expected. The insert fails and the update isn't committed.
What is going on?