At 07:05 AM 9/4/2002, you wrote:

>Is there a way I can get what the allowed values of an 'enum'
>coulmn are in mysql? I want to eventually list these values in
>a list box or something similar?

mixo,
         I can't see an easy way of getting the enum for a particular 
column. The best I could come up with (and hopefully someone can improve on 
this) is to execute a "MySQLDump -d mydatabase>schema.txt" and then use PHP 
(or whatever language you're using) to find the table.column name, search 
for "enum(", parse out the values and put them into a text file or make an 
PHP include file out of it.  Since this only needs to be done when the 
enum's have changed, and this process formats it properly for your 
language, loading the enum list will be quite fast at run time.

I thought of using "Describe table" but that will wrap a long enum list 
onto several lines in columnar format and is much harder to parse than a 
MySQLDump.

Mike


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to