How do you keep the order using SELECT WHERE IN()?
Use FIND_IN_SET:
ORDER BY FIND_IN_SET(id, '56,55,54,1,7')
You can also use FIELD:
ORDER BY FIELD(id, '56,55,54,1,7')
- http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_field
- http://ivanjovanovic.com/2008/04/01/preserving-ordering-with-where-in-clause-in-mysql/