I have a table with the name of actions
with primary key of action_id
, i am retrieving data from this table as passing my own ordered action_id
s for example
$actionIds = array(5,9,10,21,3,18,4);
$actionsTb = Engine_Api::_()->getDbtable('actions','activity');
$postSelect = $actionsTb->select()
->where('action_id IN(?)', $actionIds)
->where('type = ?', 'status')
;
now the issue is when i get the result back its in ascending order, like ( 3,4,5,9,10,18,21 ) but what i want the order of result as i passed the action ids means don't want to apply any order on the result. please help me. you can reply with simple query too.
Since your using php, why not use loop to dynamically create where clause here is the code
to test the output echo it first
Here is the complete code