Welcome Guest, Not a member yet? Register   Sign In
Multi Database, based on user
#6

Connecting to Multiple Databases

If you need to connect to more than one database simultaneously you can do so as follows:


PHP Code:
$db1 = \Config\Database::connect('group_one');
$db  = \Config\Database::connect('group_two'); 

Note: Change the words “group_one” and “group_two” to the specific group names you are connecting to.

Group_one and Group_two would be in the Config/Database.php

You define a new group besides the default group.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
Multi Database, based on user - by jldesign - 01-17-2020, 11:13 AM
RE: Multi Database, based on user - by jreklund - 01-17-2020, 12:39 PM
RE: Multi Database, based on user - by jldesign - 01-30-2020, 05:38 PM
RE: Multi Database, based on user - by InsiteFX - 09-04-2020, 08:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB