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();
5

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

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

  • 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.