SET autocommit=0;
START TRANSACTION;
DROP TABLE IF EXISTS tbl_test;
CREATE TABLE tbl_test(a int, b int);
INSERT INTO tbl_test(a,b) VALUES(1,2);
COMMIT;
INSERT INTO tbl_test(a,b) VALUES(3,4);
ROLLBACK;
SELECT * FROM tbl_test;
Return:
a b
1 2
Wednesday, January 13, 2010
Transaction with MySQL
at 7:18 AM
Labels: MySQL, MySQL Query
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment