复制代码 代码如下:
mysql_query("set autocommit=0");
$list_one = $db->fetch_first("select * from prizes where id = ".$id." FOR UPDATE");
$db->query("DELETE from prizes WHERE id =".$list_one['id']);
mysql_query("commit");
复制代码 代码如下:
START TRANSACTION | BEGIN [WORK]
COMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]
ROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE]
SET AUTOCOMMIT = {0 | 1}
复制代码 代码如下:
START TRANSACTION;
SELECT @A:=SUM(salary) FROM table1 WHERE type=1;
UPDATE table2 SET summary=@A WHERE type=1;
COMMIT;
新闻热点
疑难解答