sigmahokies Posted November 13, 2015 Share Posted November 13, 2015 I notice one of video show in youtube.com. I saw someone type in phpmyadmin database table, prepare a column, typed in name "type", then in type column "ENUM", what are people using "ENUM" in type column in phpmyadmin for? Please advised me. Thank you, Gary Quote Link to comment https://forums.phpfreaks.com/topic/299468-php-mysql-type-enum-what-is-it-for/ Share on other sites More sharing options...
Jacques1 Posted November 13, 2015 Share Posted November 13, 2015 How about the MySQL manual? The ENUM type can be used to define a fixed set of possible values. For example, a “gender” column might be declared as ENUM('male', 'female', 'other'). But be aware that the ENUM type is very inflexible and rather confusing. You cannot easily add new values, you cannot add meta data, and MySQL accepts incorrect values which are then replaced with empty strings (unless you're using strict mode). Often times, it makes more sense to use a foreign key pointing to a separate table instead of an ENUM. Quote Link to comment https://forums.phpfreaks.com/topic/299468-php-mysql-type-enum-what-is-it-for/#findComment-1526329 Share on other sites More sharing options...
sigmahokies Posted November 13, 2015 Author Share Posted November 13, 2015 Oh I see...sometimes, MySQL manual doesn't explain very clear...so, I come here. But thank you Gary Quote Link to comment https://forums.phpfreaks.com/topic/299468-php-mysql-type-enum-what-is-it-for/#findComment-1526333 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.