CodeIgniter究竟如何$this->db->trans_status()
理解事务中的查询是否成功?
来源:http ://codeigniter.com/user_guide/database/transactions.html
$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();
}
我使用MySQL作为底层数据库