Home > Backend Development > PHP Tutorial > Physical rollback in php

Physical rollback in php

不言
Release: 2023-03-28 16:48:01
Original
1694 people have browsed it

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;
        }
        
    }
Copy after login

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!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template