Magento Load Collection Using Order By -
my query generating magento collection is
$usermodel = mage::getsingleton('user/user')->getcollection()->addfieldtofilter('user_id', array('in' => array($user_id))); select `main_table`.user_name `user_table` `main_table` (user_id in('1', '3', '2'));
i want use query:
select `main_table`.user_name `user_table` `main_table` (user_id in('1', '3', '2')) order field(user_id , 1,3,2);
so display user name in same order id's input. i.e. "1,3,2"
which method used in magento load collection using order by
?
thanks in advance!
you can zend_db_select
collection
, add order zend_db_select
question:
Comments
Post a Comment