I write
mysql_query("SET AUTOCOMMIT=0");
mysql_query("START TRANSACTION");
before I write all queries. Then check if all of them are true and then write:
mysql_query("COMMIT");
But if one of query fails, I just pass COMMIT query. So do I really need ROLLBACK function if one of the queries fail? Because without ROLLBACK it also works.
Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…