This article mainly introduces the physical rollback in php, which has certain reference value. Now I share it with everyone. Friends in need can refer to it
//向该表同时添加3条数据 public function addThree($param) { $this->mod->startTrans(); //生成更新条件和数据 $res1=$this->addOne($add_data7); $res2=$this->addOne($add_data14); $res3=$this->addOne($add_data28); if($res1&&$res2&&$res3){ $this->mod->commit(); return true; }else{ $this->mod->rollback(); return false; } }
Related recommendations:
array_keys in php returns the key name of the array
The above is the detailed content of Physical rollback in php. For more information, please follow other related articles on the PHP Chinese website!