a little advice in connecting to multiple database - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: a little advice in connecting to multiple database (/showthread.php?tid=55121) |
a little advice in connecting to multiple database - El Forum - 10-11-2012 [eluser]xeroblast[/eluser] i had already checked the previous post regarding this matter and this ( http://ellislab.com/forums/viewthread/224254/ ) is the nearest answer to an advice i wanted. my current set-up : my db1 is access through the default connection. the users listed in db1 have different settings in connecting to the database. e.i. user1 db = db2 while user2 db = db3.. user1 can only see db1 & db2 while user2 can only see db1 & db3. db2 & db3 have the same tables and fields. so i want to use the same model in different connection without to call the config setting in every model i load. controller: current and working Code: function index() { Code: var user_db; Code: var user_db; my current problem is when loading multiple models in the controller which every model calls the same user configuration. i wanted to use the model to autoconnect to the database using via the 3rd parameter. Code: function index() { i want it that so i only have to call Quote:$this->db1_model->get_user_db_configuration()only once. thanks in advance. |