CodeIgniter Forums

Full Version: changing databases via $active_group?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I managed to get postgres connected. Here is the connection:

$DB1 = $this->load->database('default', TRUE);
$DB2 = $this->load->database('postgres', TRUE);


My connection to mySQL still works fine without any changes. How do I change the $active_group? I see how to change it in database.php, but I need to change it "on the fly". The image_crud uses $this->ci->db and I'd like it to use $DB2. Is there some way to load a second ci->db structure? 

Also, where did the codeigniter3 documentation go? 
Ok. It seems clear that there is no way to switch the $active_group. The CI developers smartly added the ability to open more than one database. But seemed to leave out the ability to change the default database to use. Great.

The Image CRUD library I am using seems want to use the default database. I am out of ideas.