Welcome Guest, Not a member yet? Register   Sign In
Multiple databases
#1

[eluser]_Smilie_[/eluser]
Hi,
I work with many databases at once (5), and I need a better way of switching between them.
Currently I use this:
Code:
$this->db_forum = $this->load->database('forum', TRUE);
And it seems to work just fine. The problem is, that it for some reasons set this to the default database?
So.. I execute queries like this:
Code:
$this->db_forum
However my default DB is just:
Code:
$this->db
But when I load another database the $this-db seems to get changed, either way when calling it, it attempts to look in my forum database, if another controller used that as the last one.

Is there any way to globally force that $this-db should always be my default unless specifically declared otherwise?


Messages In This Thread
Multiple databases - by El Forum - 04-27-2012, 11:06 AM
Multiple databases - by El Forum - 04-27-2012, 11:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB