Business Websites, Ecommerce solution, Process Automation!

Call to undefined method CI_DB_mysqli_driver::_error_number()

  Posted in Codeigniter | 27th July, 2018


If you are a codeigniter developer   and you are in the middle of a project scratching your heard asking why you cannot get a DB insert/delete success message determined, you are in the right place. You may not be doing anything wrong.


Here is a sample code that can generate the error message:Call to undefined method CI_DB_mysqli_driver::_error_number()


            return true;
            $this->logmessage('error', 'Attempted to delete user ' . $report['error'] . ' failed (MySQL Error:' . mysql_error() . ')');
            return false;

The Codeigniter function $this->db->_error_message() has been deprecated and will no longer work in the newer versions of codeigniter.

This error message can be fixed by changing the call

from $this->db->_error_message()



This method's response will return an array  containing code (1 or 0 )and an error message

Your new function should  be updated as fillows:



       //all good
            return true;
            echo      $report['message'];
            return false;

Post a comment

You can use the following HTML tags: <a><br><strong><b><em><i><blockquote><code><ul><ol><li><del>

Reload Image


Build YourWebsites

Showcase your business online! Whether you need a website for your associations,business, ecommerce or affiliate marketing Call us Now

MaintainWeb Assets

Maintain Your Web Assets To ensure optimal performance and 99.9% uptime.We help you fix issues,on-page SEO optimization

Build NewAdd-ons

We help our Clients to add new features: Additional pages, add payment gateway, load products to your store or build a new e-commerce store.