Welcome Guest, Not a member yet? Register   Sign In
possible to assign db_name(Database.php) in a variable or any other option
#2

(This post was last modified: 09-09-2019, 03:48 AM by InsiteFX.)

You can pass the database config group to the database method.

So you would need to setup a config group for each database that you need to use.

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.

SEE:

Multiple Connections to Same Database
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: possible to assign db_name(Database.php) in a variable or any other option - by InsiteFX - 09-09-2019, 03:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB