Welcome Guest, Not a member yet? Register   Sign In
Problem with overridden instance of CI
#1

[eluser]sangharsha[/eluser]
I have a plugin which needs database access. To get this, I have used the get_instance() of CI.
With the new instance thus created, I could make database queries.

But once I created this instance, the original instance of CI was overridden. And hence
this triggered another problem: the original instance of the CI object gets lost, and the subsequent calls to $this->db->query() doesn't work anymore.

And again I have to call the get_instance() to make the queries. Is there any way to restore the previous object?

See this conversation for details:
http://ellislab.com/forums/viewthread/59083/

Any help would be appreciated.
#2

[eluser]webthink[/eluser]
I think maybe your problem is somewhere else. I've created references to the CI object before and never had any problems making subsequent db calls using the original object. When you use =& your essentially giving yourself access to the same memory space as the original CI object. Unless you're doing something with the reference that is causing it to lose the db connection there shouldn't be a problem.




Theme © iAndrew 2016 - Forum software by © MyBB