Welcome Guest, Not a member yet? Register   Sign In
Problem with get_instance
#1

[eluser]Gerep[/eluser]
Hi fellas,


I have a library with:


Code:
private $_ci

public function __contrusct()
{
     $this->_ci = & get_instance();
}

public function test()
{
     $this->_ci->db->select('username')->from('users');
}


It returns me:


Quote:Call to a member function select() on a non-object

What am I doing wrong?

Thanks in advance for any help.
#2

[eluser]Mirge[/eluser]
Did you load the database library?
#3

[eluser]danmontgomery[/eluser]
Code:
public function __contrusct()
#4

[eluser]Mirge[/eluser]
Ha, I didn't even catch that one. Good eyes.
#5

[eluser]Gerep[/eluser]
Sorry guys, that was a typo.....in my file it is ok.

I have loaded the Database library




Theme © iAndrew 2016 - Forum software by © MyBB