Echo Out an SQL Query

Permalink
I am attempting to edit a Custom Search Block, to filter by page custom attributes.

I have altered the pages, but am unable to pull any results back when, attempting to use anything other then filterByCollectionTypeHandle

I would like to be able to see my query, to see what I am building up, but a forum search has been un-fruitfull maybe someone can help me.


How do I see my current SQL queries?

TheRealSean
 
andrew replied on at Permalink Best Answer Reply
andrew
If $pl is the object that you're performing your custom search query on, do this:

$pl->debug();


at any point before calling $pl->get() or $pl->getPage().
TheRealSean replied on at Permalink Reply
TheRealSean
Thank you that has done the trick, I had attempted to use that but was using it in the wrong location.