Problem with multiple databases |
[eluser]warrennz[/eluser]
Hey guys Any ideas to help me solve this would be appreciated. In my database configuration I have 2 databases. One named 'default' and one named 'asimov' The default database is set to 'default' and interacting with the database itself runs fine. I have a model that looks like this Code: <?php When I load this model ( not actually even running queries with $this->asimov_db yet ), it appears to make ci use that as its default database. So for example I query the default database. Code: $this->db->get('users')->limit(20)->result(); then I load the model Code: $this->load->model('usage_model'); and finally if I try to run the same query again Code: $this->db->get('users')->limit(20)->result(); 'Table 'asimov.users' doesn't exist' So what am I doing wrong? I thought by passing true as the 2nd parameter, you return a new instance which doesn't effect the main ci instance? Thanks in advance
[eluser]warrennz[/eluser]
This is probably most likely the cause http://ellislab.com/forums/viewthread/100374/ Any other suggestions appreciated |
Welcome Guest, Not a member yet? Register Sign In |