[eluser]kylehase[/eluser]
[url="http://ellislab.com/codeigniter/user-guide/database/helpers.html"]The user guide query helper page[/url] says this about affected_rows()
Quote:In MySQL "DELETE FROM TABLE" returns 0 affected rows. The database class has a small hack that allows it to return the correct number of affected rows.
This doesn't seem to be the case when using transactions.
Here's a simplified version of my code:
Code:
$this->db->trans_begin();
$this->db->where('companyID', $companyID);
$this->db->delete($tables);
if ($this->db->trans_status() === FALSE)
{
log_message('error', "xmlrpc::_delete_company\tDB error: ".$this->db->_error_message());
$this->db->trans_rollback();
return $this->xmlrpc->send_error_message('010706',"DB delete error.");
}
$this->db->trans_commit();
$affectedRows = $this->db->affected_rows();
// at this point $affectedRows is always 0.
Anyone else notice or confirm this?