Follow by Email

Wednesday, May 28, 2014

How to get sql query in magento module collection

Suppose we have a data collection and we want to get the sql query running behind it then the following code is the syntax to check it.
$collection = Mage::getModel('catalog/product')->getCollection();
echo $collection->getSelect()->__toString()

1 comment: