1
mySQL has a lot of nice features, but one "bad" thing (amongst others) is, that the results will be given sorted, even if you do NOT declare an order.
$query = "SELECT xfid, title, artist FROM ".$xoopsDB->prefix('debaser_files')." WHERE xfid IN (".implode(', ', array_map('intval', $playarray)).")";
This was my first shot and surprisingly while I printed out the results, the results were ordered. Instead of 3 2 1 it was 1 2 3. Not what I wanted! I wanted the exact order where it was in the database.
Second shot gave me finally what I wanted:
$query = "SELECT xfid, title, artist FROM ".$xoopsDB->prefix('debaser_files')." WHERE xfid IN (".implode(', ', array_map('intval', $playarray)).") ORDER BY FIND_IN_SET(xfid, '$kack')";
$kack is representing a comma-separated string of $playarray.
The solution was hiding deep on the web and MAYBE there is another solution?
Hints are appreciated!