Try these CI functions
$this->db->_error_message(); (mysql_error equivalent)
$this->db->_error_number(); (mysql_errno equivalent)
UPDATE FOR CODEIGNITER 3
Functions are deprecated, use error()
instead:
$this->db->error();
~ Answered on 2011-10-21 04:17:12