Tutorial :Can I switch active_group real time in CodeIgniter?



Question:

I want to use a different database that's defined in my $active_group in my database.php

Any ideas?


Solution:1

No... But you can actually Initialize the database class with defined parameter from your controller/model/library... example:

test = $this->load->database($config); } function index() { $this->test->get()... // bla bla bla. } } ?>

Hope this helps :)


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »