LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-27-2007, 07:26 PM   #1
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
mysql: can you get list of possible enum types from db?


one of my table fields is such:

Code:
| usr_class       | enum('consultant','client','admin','accountant','guest') | YES  |     | guest   |
I want to make a selection box on a web page that gives all of these options for the person filling in the form. Is there a way to return a list of possible enum types? I'm using php, not that it matters - I'm really looking for the sql query, if it exists.
 
Old 06-28-2007, 02:23 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
See bottom of the theory section of this doc page for theory, and further down for an example: http://dev.mysql.com/doc/refman/5.1/en/enum.html
 
Old 06-28-2007, 04:58 PM   #3
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by chrism01
See bottom of the theory section of this doc page for theory, and further down for an example: http://dev.mysql.com/doc/refman/5.1/en/enum.html
ahh... hadn't thought of doing it that way. Thanks for the URL.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Questions about enum. What would be a good use of enum? RHLinuxGUY Programming 5 06-11-2006 01:13 PM
enum inheritance in C++? graemef Programming 2 01-27-2006 10:14 PM
C Enum exvor Programming 3 09-27-2005 02:51 PM
how to change session types list lordmyth SUSE / openSUSE 1 02-20-2005 02:09 AM
mysql and complex data types... gluon Programming 2 10-29-2001 12:50 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration