Dynamic Database |
When i used ci3 i used like this:
Code: $ci =& get_instance(); and then Code: $ci->session->userdata(); to clarify i wold like to load databases dynamically based on my encrypted session. Rigth now i have : Code: public $default = [ But now with ci4 i don't know how to do. Anyone can help me? ![]()
I think you can dynamically change the database from your model or other class with
$db->setDatabase($database2_name); See https://codeigniter.com/user_guide/datab...cting.html |
Welcome Guest, Not a member yet? Register Sign In |