开发者

Magento: Get collection from custom query

We can write a custom query in Magento:

$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$write->query("insert into tablename values ('aaa','bbb','ccc')"); 

Now how can I get the output of query into a collection as I get from Mage::getModel()->getColl开发者_开发问答ection ?


Create an object that extends one of the base collection objects, and add your query to the load method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜