At 21:14 -0400 5/23/03, Urb LeJeune wrote:
>At 08:00 PM 5/23/03 -0500, Paul DuBois wrote:
>>At 19:34 -0400 5/23/03, Urb LeJeune wrote:
>>> I'm trying to extract the enumeration from a field defined as
>>>Action enum('M', 'S', 'H', 'D' ) in a table named FieldInfo.
>>> As I interpret the manual the command
>>>SELECT * FROM FieldInfo WHERE Action=0
>>> I'm getting an empty set. Can anyone point me in the
>>Sequential enumeration values are assigned values beginning with 1.
>>0 represents '', which is used for illegal values. If all
>>values in the column are one of the four values you show, an
>>empty set would be the expected result.
>>What are you trying to accomplish?
>Hi Paul and thanks for the reply.]
> I'm writing a program that will generate a form based upon a supplied
>database and table. I want to convert the enumeration into a drop menu or
>radio buttons. I detect the field is an ENUM using mysql_field_flags(). What
>I want to do next if determine the "M', 'S', 'H', 'D' enumeration.
Do you mean you want to determine the relationship between the string
enumeration values and their numeric equivalents?
Why not just make the list element values and labels both the same, i.e.,
the string values?
Otherwise, you need to get the column definition (e.g., with SHOW
COLUMNS), yank out the list of values, and iterate through them to
determine their numeric values. What language are you using? C?
> Thanks for your help.