Are you trying to use a model or resource object? here is how you can query a table using raw SQL, but you need to know the name of the scoreboard.
$w = Mage::getSingleton('core/resource')->getConnection('core_write'); $result = $w->query('select entity_id from catalog_product_entity'); if (!$result) { return false; } $row = $result->fetch(PDO::FETCH_ASSOC); if (!$row) { return false; }
When trying to use all models you can use
$products = Mage::getModel('catalog/product')->getCollection(); $products->addAttributeToFilter('entity_id', array('in' => array(1,2))); $products->addAttributeToSelect('*'); $products->load(); foreach ($products as $_prod) { var_dump($_prod->getData()); }
I use the second method for my custom modules and it works great for me, hope this answer helps :)
source share