Skip to content

Instantly share code, notes, and snippets.

@ego008
Created January 13, 2014 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ego008/8401680 to your computer and use it in GitHub Desktop.
Save ego008/8401680 to your computer and use it in GitHub Desktop.
SAE mysql 事务示例
$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