As I understand it an enumerated data type is one where the allowable set of data input is
predefined as a set. For example if the field is "weather" - the enumerated set might be "hot,warm,cool,cold".
Question is, normally the input to such a field through a PHP form would only be restricted through a drop down list form element anyway,
so is there any real benefit in configuring a your database with an ENUM data type as opposed to a VARCHAR data type?
MySQL - Question about how and why to use enumerated data types
Whether you're a seasoned veteran or a struggling beginner, Web Radiance is the web development and web design forum for you. You'll find answers to all your HTML, CSS, SEO, and Programming needs. Pull up a chair and stay awhile.
Page 1 of 1
MySQL - Question about how and why to use enumerated data types
#2
Posted 10 July 2008 - 03:34 AM
The only real benefit is that MySQL will maintain the integrity of your data for you. So you absolutely know that only one of the predetermined items can be in the field.
QUOTE(benbramz @ Aug 17 2007, 07:44 AM) Ive noticed that quite a few people are now adding quotes from the board into their signature. I think its started an new web-radiance craze.. :P
#3
Posted 10 December 2008 - 02:51 AM
Enumerated data type variables can only assume values which have been previously declared.
#4
Posted 17 May 2011 - 07:41 AM
also, it allows and promotes your code to be 'self-documenting'...
Share this topic:
Page 1 of 1


Help
This topic is locked
MultiQuote









