hi mates,
just wanna ask about these two field types :
where should i use them and how? i read the mysql manual but can't get a good info about it..
mysql field types : ENUM, SET
Moderator: General Moderators
obviously, enum are used when you have column with enumerable allowed values 
f.e. I have log table in my db, which contains log entries for my web app. It has 'type' column of type enum with allowed values: fatall,warning,note eg each record has some type, either fatal, warning or note.
There is another column, status of type set with allowed values: read, sent, flagged eg each record can be sent and/or read and/or flagged.
It might be not the best example, but it works for me...
f.e. I have log table in my db, which contains log entries for my web app. It has 'type' column of type enum with allowed values: fatall,warning,note eg each record has some type, either fatal, warning or note.
There is another column, status of type set with allowed values: read, sent, flagged eg each record can be sent and/or read and/or flagged.
It might be not the best example, but it works for me...
- mudkicker
- Forum Contributor
- Posts: 479
- Joined: Wed Jul 09, 2003 6:11 pm
- Location: Istanbul, TR
- Contact:
ok thanks weirdan,
if it's so, does it make any difference?
fore example i want to you ise for a yes or no question sotred in db.
i mean i ask in form, if user needs a picture. if yes it will be stored for yes or no.
if there's no difference between using set,enum etc. or doin it wit 0,1 (1 if yes)...
if it's so, does it make any difference?
fore example i want to you ise for a yes or no question sotred in db.
i mean i ask in form, if user needs a picture. if yes it will be stored for yes or no.
if there's no difference between using set,enum etc. or doin it wit 0,1 (1 if yes)...
- launchcode
- Forum Contributor
- Posts: 401
- Joined: Tue May 11, 2004 7:32 pm
- Location: UK
- Contact: