Welcome Guest, Not a member yet? Register   Sign In
How does $this->db->trans_status() work?
#1

[eluser]Syed Rakib Al Hasan[/eluser]
How exactly does `$this->db->trans_status()` understand that whether the queries in the transaction were successful or not?

Source: http://ellislab.com/codeigniter/user-gui...tions.html
Quote:
Code:
$this->db->trans_begin();

$this->db->query('AN SQL QUERY...');
$this->db->query('ANOTHER QUERY...');
$this->db->query('AND YET ANOTHER QUERY...');

if ($this->db->trans_status() === FALSE){
    $this->db->trans_rollback();
}
else{
    $this->db->trans_commit();
}


Messages In This Thread
How does $this->db->trans_status() work? - by El Forum - 07-02-2012, 01:31 PM
How does $this->db->trans_status() work? - by El Forum - 07-02-2012, 01:41 PM
How does $this->db->trans_status() work? - by El Forum - 07-02-2012, 04:46 PM
How does $this->db->trans_status() work? - by El Forum - 07-02-2012, 11:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB