Welcome Guest, Not a member yet? Register   Sign In
Using two databases
#1

[eluser]gcanizal[/eluser]
Hi,

I have a question related with database management. I have the database "A" as default database in the file "database.php": $active_group = "A"
In the same file I have defined database "B".
One of my controllers uses B database:
Code:
$query = "SELECT *...."
        $this->a = $this->load->database('A',TRUE);
        $result_set = $this->a->query($query);

And then it uses database "A":

Code:
$query = "SELECT *...."
        $result_set = $this->db->query($query);


But the second piece of code returns a "DATABASE ERROR".

So, I want to know if after the first piece of code the default data base has changed and, in this case, it is now "B".

Does someone use multiple databases? Which is the best way to manage them?

Thank you in advance.


Messages In This Thread
Using two databases - by El Forum - 10-22-2009, 07:07 AM
Using two databases - by El Forum - 10-22-2009, 07:24 AM
Using two databases - by El Forum - 10-22-2009, 09:03 AM
Using two databases - by El Forum - 10-23-2009, 12:24 AM
Using two databases - by El Forum - 11-04-2009, 09:09 AM
Using two databases - by El Forum - 11-04-2009, 09:16 AM
Using two databases - by El Forum - 11-04-2009, 10:17 AM



Theme © iAndrew 2016 - Forum software by © MyBB