Magento: Log the collection SQL query in Magento.
If our collection is
$collection = Mage::getModel('catalog/product')->getCollection();
then we can log the collection SQl query by using
$collection->getSelect()->__toString(); OR $collection->printLogQuery(true);
Saved as a favorite, I love your website!