PHP+MySQL事务示例
header.php
mysql_query
mysql_query("SET AUTOCOMMIT=0");mysql_query("START TRANSACTION");$a1 = mysql_query("INSERT INTO rarara (l_id) VALUES('1')"); $a2 = mysql_query("INSERT INTO rarara (l_id) VALUES('2')");if ($a1 and $a2) { mysql_query("COMMIT");} else { mysql_query("ROLLBACK");}
慕田峪9158850
Cats萌萌
炎炎设计