Is it possible to display all the query strings in Magento? I really like to see what queries are executed.
Thanks
Save this question. Show activity on this post. $products = Mage::getModel('catalog/product') ->addAttributeToFilter('status', array('eq' => 1)); echo $products->getSelect()->__toString();
When Magento builds a product collection, it layers the filters in one at a time so the full query is not assembled until time of collection load. You might want to do the following to force the collection to load and then print the query: $collection->getItems(); echo $collection->getSelectSql(true);
In Varien_Db_Adapter_Pdo_Mysql
Magento 1.4 : lib/varien/Db/Adapter/Pdo/Mysql.php
set
protected $_debug = true;
protected $_logAllQueries = true;
and (if nor already there) create the folder defined in
protected $_debugFile = 'var/debug/sql.txt';
Give read / write permission
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With