Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mySQL field and getting the ENUM list with PHP 3

Status
Not open for further replies.

BlindPete

Programmer
Jul 5, 2000
711
US
I have a field in a mySQL table that is enumerated with several text strings.

Is there a way to read this enumeration list from PHP?
I want to populate a html option list. -Pete[noevil]
 
You could issue [tt]DESCRIBE table_name[/tt] and read through the results and then fetching the enumeration and split it. I am sure there is a better way, but this is all I can think of right now. //Daniel
 
Thanks All, I will try it out, but I was hoping for something a little cleaner. -Pete[noevil]
 
yeah I wrote a function that does that. I was hoping for a function to just return the array directly, but you are right it only took minutes to write my own.

another one for the bag-o-tricks

Thanks All and a star for each of you! -Pete[noevil]
 
I did not know that you could add the column name in there, so here's a star for you sleipnir214! //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top