Welcome Guest, Not a member yet? Register   Sign In
Profiler and Multiple DB's
#8

[eluser]TheFuzzy0ne[/eluser]
Looks like the profiler will only work on database objects that are instantiated within the global scope of the CodeIgniter super object.

You might want to try something like this:

Code:
$this->db2 =& $this->load->database('db2');

Any models that need to use it can do so, you'd just need to assign the database variable by reference.

Code:
$this->load->model('my_model');
$this->my_model->db =& $this->db2;

# Now the model will use db2 as it's default database.

although in most cases, this will be done for you automatically.


Messages In This Thread
Profiler and Multiple DB's - by El Forum - 04-02-2009, 02:15 PM
Profiler and Multiple DB's - by El Forum - 04-02-2009, 08:50 PM
Profiler and Multiple DB's - by El Forum - 04-03-2009, 06:11 AM
Profiler and Multiple DB's - by El Forum - 04-03-2009, 06:47 AM
Profiler and Multiple DB's - by El Forum - 04-03-2009, 06:59 AM
Profiler and Multiple DB's - by El Forum - 04-03-2009, 07:09 AM
Profiler and Multiple DB's - by El Forum - 04-03-2009, 07:32 AM
Profiler and Multiple DB's - by El Forum - 04-03-2009, 08:11 AM
Profiler and Multiple DB's - by El Forum - 04-03-2009, 12:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB