In order to use transactions in your database queries. You need to use Codeigniter’s transaction methods provided by db library of Codeigniter. The basic snippet is as follows:

$this->db->trans_start(); # Starting Transaction

//Do your Stuff Here i.e. Queries you wants to run on database

$this->db->trans_complete(); # Completing transaction
if($this->db->trans_status() === TRUE){
$this->db->trans_commit(); //Commits Transaction if status TRUE
} else {
$this->db->trans_rollback(); //Rollback Transaction if status FALSE
}

Comments


In order to use transactions in your database queries. You need to use Codeigniter’s transaction methods provided by db...

Read Post

In order to use transactions in your database queries. You need to use Codeigniter’s transaction methods provided by db...

Read Post

Leave a Reply

Your email address will not be published. Required fields are marked *