1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| mysql_query('START TRANSACTION') or exit(mysql_error()); $ssql1="insert into pf_item values('22','我们','30')"; if(!mysql_query($ssql1)) { echo $ssql1.mysql_errno().":".mysql_error()."<br>"; mysql_query('ROLLBACK') or exit(mysql_error()); exit; }
$ssql1="insert into pf_item values('21','hell','10')"; if(!mysql_query($ssql1)) { echo $ssql1.mysql_errno().":".mysql_error()."<br>"; mysql_query('ROLLBACK') or exit(mysql_error()); exit; }
mysql_query('COMMIT') or exit(mysql_error());
mysql_close($LinkID);
|