TP5 mysql事務處理

1.引用TP5的think\Db類:use think\Db; 2.下面爲實現代碼: Db::startTrans(); //啓動事務 try { 這裏寫SQL語句 Db::commit(); //提交事務 } catch (\PDOException $e) { Db::rollback(); //回滾事
相關文章
相關標籤/搜索