En fait, c'est mieux :
SELECT * FROM your_table
WHERE id IN (5,2,6,8,12,1)
ORDER BY FIELD(id,5,2,6,8,12,1);
voici la documentation FIELD :
http://dev.mysql.com/doc /refman/5.0/en/string-functions.html#function_field
En fait, c'est mieux :
SELECT * FROM your_table
WHERE id IN (5,2,6,8,12,1)
ORDER BY FIELD(id,5,2,6,8,12,1);
voici la documentation FIELD :
http://dev.mysql.com/doc /refman/5.0/en/string-functions.html#function_field