Print All SQL Queries in Magento

Activate the Zend SQL Profiler with the following node in your local.xml:


Then you can access the profiler somewhere in your code and retrieve a lot of informations about all executed queries:

$profiler = Mage::getSingleton('core/resource')

To simply output all queries:


Question and answer on StackOverflow