Welcome Guest, Not a member yet? Register   Sign In
How to see MySQL activities on profiler from all active MySQL connections?
#1

[eluser]MatteMatte[/eluser]
Hi Everyone,

On my CI powered website, the profiler is enabled and I can see MySQL activity from the main database set in database.php

But I can not see other MySQL activities happening on other MySQL connections opened dynamically during the code run $config and load->database($config, true) routines.

Any suggestions about how to see all MySQL activities from all MySQL connections on profiler?

Thanks.
Mat.
#2

[eluser]WanWizard[/eluser]
If you create a second connection and store it in a local variable, the profiler won't be able to pick it up.

Use:
Code:
$CI =& get_instance();
$CI->db2 = $this->load->database($config, TRUE);
// make it known to our controller
$this->db2 =& $CI->db2;

instead of:
Code:
$db2 = $this->load->database($config, TRUE);
#3

[eluser]MatteMatte[/eluser]
Great, thanks! It works like a charm!

Cheers.




Theme © iAndrew 2016 - Forum software by © MyBB