CodeIgniter Forums
[SOLVED]Multiple databse connection - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: [SOLVED]Multiple databse connection (/showthread.php?tid=42419)



[SOLVED]Multiple databse connection - El Forum - 06-07-2011

[eluser]Ivar89[/eluser]
Hi,

Is it possible to make connection to two different databases simultaneously?
and how would that go?

Code:
$active_group = "default";
$active_group2 = "second"; //???
$active_record = TRUE;

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "****";
$db['default']['database'] = "lol";
$db['default']['dbdriver'] = "";
$db['second']['hostname'] = "localhost";
$db['second']['hostname'] = "localhost";
$db['second']['username'] = "root";
$db['second']['password'] = "****";
$db['second']['database'] = "boom";
$db['second']['dbdriver'] = "";

I knowI can test it but its an exam question so not enough time haha

thanks in advance


[SOLVED]Multiple databse connection - El Forum - 06-07-2011

[eluser]danmontgomery[/eluser]
http://ellislab.com/codeigniter/user-guide/database/connecting.html

"Connecting to Multiple Databases"


[SOLVED]Multiple databse connection - El Forum - 06-07-2011

[eluser]Ivar89[/eluser]
Thanks!