Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more