Welcome Guest, Not a member yet? Register   Sign In
Store multiple DB connection strings in database...
#4

[eluser]CroNiX[/eluser]
I've never tried to do it that way (using a named group from /config/database.php, but overriding values before connecting), so you'd have to play with it and test. You could always just create a new $config array and pass that directly to $this->load->database($config, TRUE);

Code:
$config['hostname'] = "localhost";
$config['username'] = "myusername";
$config['password'] = "mypassword";
$config['database'] = "mydatabase";
$config['dbdriver'] = "mysql";
$config['dbprefix'] = "";
$config['pconnect'] = FALSE;
$config['db_debug'] = TRUE;
$config['cache_on'] = FALSE;
$config['cachedir'] = "";
$config['char_set'] = "utf8";
$config['dbcollat'] = "utf8_general_ci";

$db2 = $this->load->database($config, TRUE);


Messages In This Thread
Store multiple DB connection strings in database... - by El Forum - 07-08-2014, 01:40 PM
Store multiple DB connection strings in database... - by El Forum - 07-08-2014, 02:15 PM
Store multiple DB connection strings in database... - by El Forum - 07-08-2014, 02:24 PM
Store multiple DB connection strings in database... - by El Forum - 07-08-2014, 02:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB