Multiple Databases - Where can I store config data from database for application use? |
[eluser]ladooboy[/eluser]
@Nick Thanks for the help, it's working now. I've already had MY_Model so I went again with that approach. I had tried it before, but it wouldn't work. Just to summarize what I did, in case someone else is having the problem. All my models are extending MY_Model. I am loading this method from MY_Model constructor. Code: public function load_user_db() When I login in my auth_model I do this: Code: $database_details = (array)json_decode($user_result->database_details); This is just so that my auth_model has access to the new database as well. Few things I've came across is: 1. I couldn't make it use the session table in the data1 Databases(because name could be anything), but only in the default session table. This means I also needed to leave these properties for the users database as TRUE, otherwise it would slow down the app and add additional 2 seconds to load the pages. Code: $db['localhost']['pconnect'] = TRUE; 2. I had to alter the DB_driver.php to add "$this->db_select();" select db |
Welcome Guest, Not a member yet? Register Sign In |