Welcome Guest, Not a member yet? Register   Sign In
Ci instance vs this keyword
#1

[eluser]Unknown[/eluser]
Hi,
I did many jobs in CI. Sometimes i fetched a problem, the problem is,
$this->db->insert() or any member function do work fine, sometimes behave wrong. shows fatal error "call a member function on non-object". I don't know why?
When this type of error occurred, i just instantiated a variable like $ins = & get_instance(); then do $ins->db->insert();that works fine!!.

So my query is why this type of problem occurred? Is this was CI Bug.

Thanks in advanced.



#2

[eluser]CroNiX[/eluser]
It really depends on how and where you're using it, which you didn't show.




Theme © iAndrew 2016 - Forum software by © MyBB