Created
January 13, 2014 14:53
-
-
Save ego008/8401680 to your computer and use it in GitHub Desktop.
SAE mysql 事务示例
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sql_a = '...'; | |
$sql_b = '...'; | |
$mysql->runSql("BEGIN"); | |
$res_a = $mysql->runSql($sql_a); | |
$res_b = $mysql->runSql($sql_b); | |
if ($res_a && $res_b) { | |
$mysql->runSql("COMMIT"); | |
} else { | |
$mysql->runSql("ROLLBACK"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment