Setting up 2 databases - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Setting up 2 databases (/showthread.php?tid=64584) |
Setting up 2 databases - doomie22 - 03-07-2016 Hi there, I am just trying to setup another database within my project. I have done the following within database.php PHP Code: $active_group = 'default'; I have taken out the details so that its not massive. I have tried to connect to it but it just errors with cannot find $db2 and I am getting no where. Can anyone show me how I can connect to this second database so I can get information from it. Thanks, Doomie RE: Setting up 2 databases - donpwinston - 03-07-2016 http://codeigniter.com/user_guide/database/connecting.html RE: Setting up 2 databases - mixinix - 03-07-2016 (03-07-2016, 12:19 PM)Your config: Wrote: Access with: PHP Code: $q1 = $db1->query(...)->... or with other methods |