Welcome Guest, Not a member yet? Register   Sign In
Database Config Load Question
#1

[eluser]ChrisMiller[/eluser]
Ok basically I am sure I am just skipping over it somewhere but what I want to do is use the ci database library twice in a controller, when the script is loaded it connects to the database in the config file which is easy to do but then I want to connect to a seperate database using a config specified in file... so the result is $this->db-> = the normal database and $this->app_db = the new loaded database....? any ideas? also I cant just put the config values in the database config file as they are loaded from a database depending on what user is accessing the app.

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['active_r'] = TRUE;

$this->load->database($config);
How can I get that so it can be loaded via a diffrent class name like I can do with my libraries. ie $this->db2->


Messages In This Thread
Database Config Load Question - by El Forum - 01-29-2008, 05:32 AM
Database Config Load Question - by El Forum - 01-29-2008, 05:42 AM
Database Config Load Question - by El Forum - 01-29-2008, 10:47 AM
Database Config Load Question - by El Forum - 01-29-2008, 12:03 PM
Database Config Load Question - by El Forum - 03-08-2008, 07:02 PM
Database Config Load Question - by El Forum - 03-14-2008, 02:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB