No, I do write the query and am stll open to sorting it in the query. Before I run my query I take my array and convert it into a list of values separated by comma.
$MemIDs = implode(",", $IDs);
and then use it in the query
"SELECT* ...
FROM t1
WHERE memberID IN (".$MemIDs.")
// if I could only do something like this, my problem will be solved
ORDER BY memberID (".$MemIDs.")
If I go PHP route, the I do need to use some sort of function because the results of the query output should be in the same order as the array, or at least the first result should be corresponding to the first array value.
Now, I've gone a long way in terms of array familiarity, but they still confuse me quite a bit. Maybe I can do in the query some thing like
ORDER BY CASE 1, $IDs[0], CASE 2 // the rest of the results -- it's only 10
🙂