Logging all sql-queries |
How I can log all sql-queries in current page?
I found this code PHP Code: $this->db->queries but when I located it at the end of index.php, it crashed the site.
$this isn't in scope in the index.php. $this is when you're inside a class, and ->queries is only there if you're in a class that has the ci3 god object.
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
@fs444,
There is a couple of ways to approach this. - You could turn on the profiler for this page which will list ALL executed queries (at the bottom of the page). [https://codeigniter.com/userguide3/gener...pplication] - You could turn on logging which tracks all executed queries along with other system messages. [https://codeigniter.com/userguide3/gener...r-handling] |
Welcome Guest, Not a member yet? Register Sign In |