how to commit or rollback changes made in a database in mysql code example
Example 1: do we need to specify commit to save changes in mysql
BEGIN;
SELECT @A:=SUM(salary) FROM table1 WHERE type=1;
UPDATE table2 SET summmary=@A WHERE type=1;
COMMIT;
Example 2: do we need to specify commit to save changes in mysql
SET AUTOCOMMIT=0