日期:2014-05-17 浏览次数:20441 次
public static function exec_sql_tran($arr_sql){
$result=true;
$con = new MySQLi(DBHOST,DB_USER,DB_PASSWD,DB_NAME);
$con->autocommit(FALSE);
foreach($arr_sql as $key=>$sql){
if (!$con->query($sql)) {
echo $con->error."<br>/";
$resulf=false;
$con->rollback();
break;
}
}
print_r($result);
if($result){
$con->commit();
}
else{
$con->rollback();
}
$con->close();
}