Welcome Guest, Not a member yet? Register   Sign In
$this->db->_error_message() alternative ?
#1

[eluser]quasiperfect[/eluser]
hi

i updated to the latest version of ci from git and now i get a "Fatal error: Call to protected method CI_DB_mysql_driver::_error_message() from"

any alternative to get the error message from the query ?

#2

[eluser]CroNiX[/eluser]
Not without altering the core, unfortunately. The database is one of the few, if not the only, libraries that you can't extend like the rest of CI.

If this is really needed, I would just create a simple new method in the db library that returns the result of that protected method.
#3

[eluser]toopay[/eluser]
[quote author="quasiperfect" date="1328699740"]hi

i updated to the latest version of ci from git and now i get a "Fatal error: Call to protected method CI_DB_mysql_driver::_error_message() from"

any alternative to get the error message from the query ?

[/quote]
No one stopped you to use the native mysql driver function. If you turn OFF db_debug option in your config/database.php, you could then debug it yourself like :
Code:
$query = $this->db->get('non_exists_table');
if ( ! $query)
{
   echo 'Error Number:'.mysql_errno($this->db->conn_id);
   echo 'Error Message:'.mysql_error($this->db->conn_id);
}
else
{
   // No errors
}




Theme © iAndrew 2016 - Forum software by © MyBB