Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Coldfusion with ENUM Field Type!!

New Here ,
Apr 03, 2010 Apr 03, 2010

Can someone please help me with selecting ENUM fields for a MySQL database with ColdFusion?  I've searched and searched and no examples online.  Here is MySQL support showing numerous languages: http://docs.codecharge.com/studio3/html/index.html?http://docs.codecharge.com/studio3/html/Programmi...

My code looks like this:

<!--- get rights --->
    <CFQUERY datasource="test" Name="GetRights">
    SHOW Columns From User LIKE 'RIGHTS'
    </cfquery>

For the RIGHTS, they can be one of 3 things...example we'll use is "user", "admin", "superadmin" - so query works just fine, but now I cannot figure out how to reference the values to display them in a cfoutputt. I have tried #GetRights.Columns# and #GetRights.Rights# with no luck....i know there has to be an easy way to do this, but again no examples online (completely amazed by this).  I'd like to keep from creating extra tables with foreign keys as this is so much simpler.

Thanks in advance.

~Brandon

damango79@aol.com

3.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 03, 2010 Apr 03, 2010
LATEST

Looks like I found my answer after submitting this as it had a similar thread here (although Google didn't find it) that had example:

http://forums.adobe.com/message/78451#78451

The only part I did different than him is that I just stopped at the conversion to array and then used CFLOOP like so to look through them:

Rights:
    <Select name="Rights">


    <cfloop array=#rightsArray# index="i">

        <cfoutput>       
       
        <Option value="#i#">#i# </option>

        </cfoutput>

    </cfloop>      


    </Select>

~Brandon

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources