I'm creating a stored procedure into which i'm passing an "order" dynamically like so:

CREATE PROCEDURE `getStuff`(IN orderSQL VARCHAR(100))
BEGIN
SELECT id, name, createdate
FROM mytable
ORDER BY
CASE WHEN orderSQL='id_desc' THEN CONCAT(id, '') END DESC,
CASE WHEN orderSQL='id_asc' THEN CONCAT(id, '') END ASC,
CASE WHEN orderSQL='name_desc' THEN name END DESC,
CASE WHEN orderSQL='name_asc' THEN name END ASC,
CASE WHEN orderSQL='date_desc' THEN CONCAT(createdate, '') END DESC,
CASE WHEN orderSQL='date_asc' THEN CONCAT(createdate, '') END ASC
END