Forum Moderators: coopster
In other words, SET allows for multiple choices when ENUM allows only a single choice - which should work for you, since a person can only be either male or female, not both.
if (colmn_1 == '0')
echo "Male" //or whatever you want
else
echo "Female"
You just complicated the solution by 4 lines of additional code.
A SET is a string object that can have zero or more values.
An ENUM is a string object with a value chosen from a list of allowed values.In other words, SET allows for multiple choices when ENUM allows only a single choice - which should work for you, since a person can only be either male or female, not both.
So would set be good for something like "What states have you lived in durring the past 5 years?"
Then someone could select (Maine, Ohio, Florida) But it would just be stored in one field?
if this is the case then would it be a long string or an array?
Sarah
also moltar your state id wouldn't work if a person lived in more then one state in the past 5 years.
I guess maybe a better exsample following my train of thought would be
"What types of food do you like?"
with posible awnsers being:
Spicy
Mexican
Fast
Chinese
Korean
Sushi
Sarah
Generally I'd say it depends on the situation. If the option list is relatively short and the options will not be updated often, then go with either ENUM or SET.
If you need a dynamic option list (new types of foods added constantly) or you have an extensive option list then go with a separate table(s).