Welcome Guest, Not a member yet? Register   Sign In
Multiple Databases - Where can I store config data from database for application use?
#7

[eluser]Nick Woodhead[/eluser]
You could probably do it two ways...

1) Instead of creating the dynamic_db model create MY_model extends CI_Model with the same functionality and then have your other models extend MY_Model instead of CI_Model

2) If you don't need access to the user db after the login process then you could just autoload the user database as the default in config/autoload.php and then overwrite the $this->db during the login process once you have retrieved the new db credentials

function login () {
$this->db->query('user db query'); //validate login and get db credentials
$this->db = $this->load->database($database_details, TRUE);
$this->db->query('dynamic db query'); //should be available in all models now
}


Messages In This Thread
Multiple Databases - Where can I store config data from database for application use? - by El Forum - 12-29-2012, 10:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB