Welcome Guest, Not a member yet? Register   Sign In
Where to define database when not autoloading?
#1

Hi.

I have 2 databases and I want to optimize my site.

Should I call

PHP Code:
$this->db1 $this->load->database('somegroupname1'true);
$this->db2 $this->load->database('somegroupname2'true); 

From the Controller or from the Model ?


I am worried that my controller loading 3 to 5 models should I call the database from the controller or from the model.  Some models use 1 database and some use another.  Some models do not require any models and some only require 1 database connection.

I am trying to reduce database connections..
Thanks
Reply


Messages In This Thread
Where to define database when not autoloading? - by daveaton - 04-27-2016, 01:15 PM



Theme © iAndrew 2016 - Forum software by © MyBB