We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Needs to be a better way to debug Active Record Queries inside of EE modules.

Development and Programming

Jamie Poitra's avatar
Jamie Poitra
409 posts
14 years ago
Jamie Poitra's avatar Jamie Poitra

Something like a working last_query() value be great.

Jamie

       
Derek Jones's avatar
Derek Jones
7,561 posts
14 years ago
Derek Jones's avatar Derek Jones

Jamie, it does work; are you on the front end or back end, and do you have debug set to 0 or the profiler disabled?

       
Jamie Poitra's avatar
Jamie Poitra
409 posts
14 years ago
Jamie Poitra's avatar Jamie Poitra

Hey Derek,

In the database config debug is set to TRUE.

I’m not sure what the profiler is, and other than a mention in the change log for the installer I don’t see it mentioned in the docs at all.

I’ve not done anything weird install wise. It’s just a normal install of EE 2 no unusual tweaks or anything like that. And this is an attempt to debug an Active Record query on the back end inside of a module with a CP Interface.

JAmie

       
Derek Jones's avatar
Derek Jones
7,561 posts
14 years ago
Derek Jones's avatar Derek Jones

The Profiler is a feature of CodeIgniter. It replaced the Display SQL Queries preference in Output and Debugging, though the user guide seems to still refer to it by the older name (I’ll let the dev team know).

To save memory, queries are not saved unless the system knows that they are going to be displayed (i.e. the profiler is enabled). So if you enable the profiler, you should see not only all of the queries for the page request, but also the queries will be saved for use by last_query(). Alternatively, you can immediately set $EE->db->save_queries to TRUE prior to the execution and call to last_query().

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.