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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.