Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] How do you connect to two databases cleanly ?
#6

[eluser]Henrik Pejer[/eluser]
You would, of course, have to save the different connections.

Something like this should work:

Code:
$this->db1=$this->load->database('group_one', TRUE);
$this->db2=$this->load->database('group_two', TRUE);

then you'd use $this->db1->query('select...') or $this->db2->query('select....') whenever you want to use the connection.

I haven't used two databases with CI but I believe that should work.

Good luck!


Messages In This Thread
[SOLVED] How do you connect to two databases cleanly ? - by El Forum - 07-27-2007, 04:51 AM
[SOLVED] How do you connect to two databases cleanly ? - by El Forum - 07-29-2007, 05:57 PM
[SOLVED] How do you connect to two databases cleanly ? - by El Forum - 07-30-2007, 02:07 AM
[SOLVED] How do you connect to two databases cleanly ? - by El Forum - 08-01-2007, 01:59 AM
[SOLVED] How do you connect to two databases cleanly ? - by El Forum - 08-01-2007, 02:00 AM
[SOLVED] How do you connect to two databases cleanly ? - by El Forum - 08-01-2007, 02:50 AM
[SOLVED] How do you connect to two databases cleanly ? - by El Forum - 08-01-2007, 04:01 AM
[SOLVED] How do you connect to two databases cleanly ? - by El Forum - 08-01-2007, 04:25 AM
[SOLVED] How do you connect to two databases cleanly ? - by El Forum - 08-01-2007, 04:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB