In a web application, I need to populate a <select> with all possible values of a MySQL enum.
When I execute either of:
SHOW COLUMNS FROM mytable LIKE 'mycolumn';
SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'mytable' AND COLUMN_NAME = 'mycolumn';
I always end up with enum('valueA','valueB','valueC').
I know I can parse it with PHP but can it be done using SQL only? I need something like this:
+-----------------+ | values | +-----------------+ | valueA | | valueB | | valueC | +-----------------+