you mean so that the results set is the same order as the the array?
If so, you would need to hand code the output to loop through the array and compare the id in the array against the id of the record and only display if the match
the pseudo code logic will look like:
i=0;
loop through the recordset {
loop through the recordset {
if( $array[i] == recordset['idColumn']) {
echo recordset value
}
i++;
}
}