guyfromfl Posted January 18, 2009 Share Posted January 18, 2009 Is there a way to read a enum'd field's values into an array in php so i can populate a dropdown box with the possible choices? This way I don't have to change anything if i alter the table. thanks Quote Link to comment https://forums.phpfreaks.com/topic/141384-mysql-enum-and-php/ Share on other sites More sharing options...
Mchl Posted January 18, 2009 Share Posted January 18, 2009 You could parse results of EXPLAIN `table` `enumField` Quote Link to comment https://forums.phpfreaks.com/topic/141384-mysql-enum-and-php/#findComment-740089 Share on other sites More sharing options...
corbin Posted January 19, 2009 Share Posted January 19, 2009 What kind of values are you using in an enum? Like what will the column hold? Perhaps you shouldn't use an enum. Quote Link to comment https://forums.phpfreaks.com/topic/141384-mysql-enum-and-php/#findComment-740219 Share on other sites More sharing options...
impressthenet Posted September 15, 2009 Share Posted September 15, 2009 Is there a way to read a enum'd field's values into an array in php so i can populate a dropdown box with the possible choices? This way I don't have to change anything if i alter the table. thanks You mean something like this? $enumArray = explode(",",$row["enumtype"]); Quote Link to comment https://forums.phpfreaks.com/topic/141384-mysql-enum-and-php/#findComment-919023 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.