I execute some MySQL queries using START TRANSACTION
, but after I execute COMMIT
the following queries do not take effect in the database
The following queries were executed using mysqli_query in the same order:
SET names utf8
SET AUTOCOMMIT=0
START TRANSACTION
INSERT INTO table1 (a, b) VALUES (1,2) ;
INSERT INTO table2 (c, d) VALUES (1,1) ;
INSERT INTO table2 (c, d) VALUES (2,1) ;
COMMIT
INSERT INTO table3 (e, f) VALUES (9,7) ;
<-- This does not insert anything!!
Note: The last query should be executed out of the START TRANSACTION
COMMIT
block.
That is really driving me crazy. Because I cannot seem to figure out the problem!!