¿Algo como esto funcionaría? básicamente dices ordenar por los valores de campo y hacer que se vean como '52', '46',... etc.
SELECT
GROUP_CONCAT(DISTINCT options.option_name
ORDER BY FIELD( options.id,
concat('"',
replace(selected, ',', '","'),
'"')
)
SEPARATOR ','
) AS selected,
user_login.firstname, user_login.lastname,
event.event_title
FROM options, user_login, event, votes, questions
WHERE event.id = ? AND questions.Event_id = event.id
AND votes.user_id = user_login.id AND votes.question_id = questions.id
AND FIND_IN_SET(options.id, selected)
GROUP BY user_login.id
ORDER BY user_login.class
EDITAR:
mi forma preferida de hacer esto es crear una variable que tenga la cadena... es más fácil de leer y puedes asegurarte de que hace el orden correcto de esta manera...
SET @order_field := (
SELECT
group_concat(
CONCAT('"', replace(selected, ',', '","'), '"')
)
FROM votes);
entonces la consulta sería mucho más fácil de leer...
SELECT
GROUP_CONCAT(DISTINCT options.option_name
ORDER BY FIELD( options.id, @order_field)
SEPARATOR ','
) AS selected,
user_login.firstname, user_login.lastname,
event.event_title
FROM options, user_login, event, votes, questions
WHERE event.id = ? AND questions.Event_id = event.id
AND votes.user_id = user_login.id AND votes.question_id = questions.id
AND FIND_IN_SET(options.id, selected)
GROUP BY user_login.id
ORDER BY user_login.class