codeigniter Call to a member function query() on a non-object

if you are getting this error, then the first step towards the solution is to check that the ‘database’ library is autoloaded in the “autoload.php” file in the config directory under system/application

if not please add that. i.e. $autoload[‘libraries’] = array(‘database’, ‘session’);

About these ads

15 thoughts on “codeigniter Call to a member function query() on a non-object

  1. I believe other website proprietors should take this site as an model, very clean and fantastic user friendly design.

  2. it’s not work for me, when i try combining ionauth2 + ci 2.x always show error like ‘Fatal error: Call to a member function database() on a non-object in’ where in models\ion_auth_model.php on line 167, so i try to put inititation of object for this like this ” $CI = & get_instance() after parent constructor. :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s