CodeIgniter Forums
Multiple database issues..? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Multiple database issues..? (/showthread.php?tid=5860)



Multiple database issues..? - El Forum - 02-06-2008

[eluser]Nanodeath[/eluser]
I'll give more details if it turns out to be necessary, but I can simplify it down to the following hypothetical situation.

Two lines of code:
Code:
$this->otherDB = $this->load->database('other', true);
$this->load->database();

and later,
Code:
$query = $this->db->query("SELECT * FROM tableInDatabase");

However, it looks for tableInDatabase in $this->otherDB (and doesn't find it) instead of looking in $this->db.

Note that the "two lines of code" are actually in conceptually independent models, so I don't see why they shouldn't be able to handle their own database connections.

Am I using databases wrong or is this a bug?

Thanks!