2

Can someone tell me the Sql that this query runs?

$category = Mage::getModel('catalog/category')->getCollection();
            $category->addAttributeToFilter("Top_Menu" , array('eq' => '146'));
            $category->addAttributeToSelect('name','parent_id','entity_id','url');
            $category->setOrder("parent_id", "ASC");
            $category->load();

1 Answer 1

5

You can simply find this yourself by adding a true as first param to ->load();

public function load($printQuery = false, $logQuery = false)

1
  • Or you can do $categroy->getSelect()->__toString() Commented Nov 17, 2014 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.