Welcome Guest, Not a member yet? Register   Sign In
Multiple database connections that are user defined
#3

[eluser]getSurreal[/eluser]
I'm a little stuck on this.

I have my SQL connection info stored in a table. I have a model that retrieves this information, but I'm having difficutly passing it back to the controller to work with it. Ideally what I'd like to do is just extend the same settings that are in config/database.php

$db['db2']['hostname'] = "mssqlserver";
$db['db2']['username'] = "vmr";
$db['db2']['password'] = "vmr";
$db['db2']['database'] = "vmr";
$db['db2']['dbdriver'] = "mssql";
$db['db2']['dbprefix'] = "";
$db['db2']['pconnect'] = TRUE;
$db['db2']['db_debug'] = TRUE;
$db['db2']['cache_on'] = FALSE;
$db['db2']['cachedir'] = "";
$db['db2']['char_set'] = "utf8";
$db['db2']['dbcollat'] = "utf8_general_ci";
$db['db2']['port'] = "1433";

I could have any number of additional database connections so I need to loop through them. How can I put a variable in my first array position so it can be assigned by the query? And how can I make these new connection settings available globally in my application the same as if they were originally placed in the config/database.php file?


Messages In This Thread
Multiple database connections that are user defined - by El Forum - 11-12-2009, 11:24 AM
Multiple database connections that are user defined - by El Forum - 11-12-2009, 04:23 PM
Multiple database connections that are user defined - by El Forum - 12-14-2009, 11:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB