mysqli执行mysql事务的问题
<br /> public static function exec_sql_tran($arr_sql){<br /> $result=true;<br /> $con = new MySQLi(DBHOST,DB_USER,DB_PASSWD,DB_NAME);<br /> $con->autocommit(FALSE);<br /> foreach($arr_sql as $key=>$sql){<br /> if (!$con->query($sql)) {<br /> echo $con->error."<br>/";<br /> $resulf=false;<br /> $con->rollback();<br /> break;<br /> }<br /> }<br /> print_r($result);<br /> if($result){<br /> $con->commit();<br /> }<br /> else{<br /> $con->rollback();<br /> }<br /> $con->close();<br /> }<br />