mysqli执行mysql事务的问题
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();
}