How to print sql query in Magento - Magento Source24

How to print sql query in Magento

 Hello Magento friends today's i'm share with you to How to print sql query in Magento 

if you want to print your query when you get collection on database to add this bellow line code in file where you get collection.

try this example : 


<?php

$collection = Mage::getModel(‘catalog/category’)->load($categoryId)
->getProductCollection()
->addAttributeToSort(‘name’, ‘ASC’);

echo $collection->printlogquery(‘true’)


Deepak Kumar Bind

Success is peace of mind, which is a direct result of self-satisfaction in knowing you made the effort to become the best of which you are capable.

Post a Comment

If you liked this post please do not forget to leave a comment. Thanks

Previous Post Next Post