Connecting to the database in a Created Library - CodeIgniter

Posted by Brogrammer on Stack Overflow See other posts from Stack Overflow or by Brogrammer
Published on 2011-12-01T01:48:31Z Indexed on 2011/12/01 1:50 UTC
Read the original article Hit count: 144

Filed under:
|
|
|

I have a little issue right now and its bugging me, hopefully one of you guys will be able to help me out.

Basically I'm creating a library to use in CodeIgniter and I'm getting this error:

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Functions::$db

Filename: libraries/Functions.php

Line Number: 11

The Database library is already on autoload aswell as my functions library:

$autoload['libraries'] = array('database','session','encrypt','functions');

The Functions.php file is located in the application/libraries folder accordingly.

Line number 11 consists of this:

$this->db->where('username', $data);

Not sure as to why the db is an undefined property?

© Stack Overflow or respective owner

Related posts about php

Related posts about database