Giulio Pons has a quick post with a code snippet showing how to grab the possible values for an ENUM or SET field on a MySQL database.
This function returns an array with the elements allowed in a ENUM or SET mysql field. This can be usefull if youâ€™re making some automation and need to retrieve those values without writing them in your code.
The function uses the database's metadata to get the column information for a table and filter out the "enum" information from that. The column information includes the set of values possible and a few simple string handling functions make it easy to grab them. They could also be replaced by a regular expression or two to grab the same information more concisely.