I have a array with some id's I use to select a row set form the database.
The selection goes well but I dont receive my results back in the ordered given array
Inserted array (var_dump)
0 => string '40201' (length=5)
1 => string '44089' (length=5)
2 => string '42106' (length=5)
3 => string '42740' (length=5)
4 => string '43812' (length=5)
5 => string '44331' (length=5)
6 => string '42109' (length=5)
7 => string '44147' (length=5)
8 => string '40464' (length=5)
9 => string '42108' (length=5)
Output array
array
0 =>
array
'id' => string '40201' (length=5)
1 =>
array
'id' => string '40464' (length=5)
2 =>
array
'id' => string '42106' (length=5)
3 =>
array
'id' => string '42108' (length=5)
4 =>
array
'id' => string '42109' (length=5)
5 =>
array
'id' => string '42740' (length=5)
6 =>
array
'id' => string '43812' (length=5)
7 =>
array
'id' => string '44089' (length=5)
8 =>
array
'id' => string '44147' (length=5)
9 =>
array
'id' => string '44331' (length=5)
My zend query:
$select = $this->_db
->select()
->from(array('file' => 'filehosts'), array('id'))
->where('file.id IN(?)', $array);
$result = $this->getAdapter()->fetchAll($select);
return $result
I think it's the conclusion of the id following up, first one is taken and then he just take the one who he finds first who is in the array right? How can I make this more strict so the query doesn't change the array order?
Thanks in advance. Nick