Can someone tell me the Sql that this query runs?

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

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

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

| improve this answer | |
  • Or you can do $categroy->getSelect()->__toString() – James Cowie Nov 17 '14 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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