Welcome Guest, Not a member yet? Register   Sign In
changing databases via $active_group?
#1

(This post was last modified: 06-13-2020, 12:35 PM by richb201.)

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? 
proof that an old dog can learn new tricks
Reply
#2

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.
proof that an old dog can learn new tricks
Reply




Theme © iAndrew 2016 - Forum software by © MyBB