Magento debug and print mysql query

Sometimes it happens while debugging we want to see the mysql query. So below is the code which when called on a collection will display the query for that collection.


I found a better version for the same below


This will give you only the query.

This entry was posted in Magento. Bookmark the permalink.

2 Responses to Magento debug and print mysql query

  1. Thanks for sharing..

  2. Naleen Subedi says:

    Thanks, It worked for me.