Home  >  Article  >  Backend Development  >  Physical rollback in php

Physical rollback in php

不言
不言Original
2018-05-31 14:01:331567browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn