Hi Bill, this is the idea I was getting at:

<!--- Get the feature codes --->
<cfquery name="featureCodesQuery" ...>
select feature_code, feature_description
from featureCodes
</cfquery>

<!--- Put the feature codes into a struct --->
<cfset featureCodes = {}>
<cfloop query="featureCodes">
    <cfset featureCodes[feature_code] = feature_description>
</cfloop>

<!--- Display the feature codes --->
<cfloop index="code" list="#FEATURE_CODES#" delimiters="#chr(44)#">
    <cfif structKeyExists(featureCodes,code)>
        #featureCodes[code]#
    <cfelse>
        #code#
    </cfif>
</cfloop>


On 1 June 2010 09:43, Bill Hartley <[email protected]> wrote:

>
> Is there a way I can do it with in the CF code on the page itself and not
> in
> the select statement in the query?
>
> Something like
> <cfset fullname="#MLS_AGENT_NAME#">
> #gettoken(fullname,2,",")# #gettoken(fullname,1,",")#
> <HR><BR></CFOUTPUT>
> <cfset codelist="#FEATURE_CODES#">
> <cfloop index="code" list="#codelist#" delimiters="#chr(44)#">
> <CFIF code EQ "#featurecodes.feature_codes#">
> #featurecodes.description#
> <CFELSE>
> #code#
> </CFIF>
> </cfloop>
>
> I know this this code is totally wrong but thats the situation that would
> help me the most....anybody know the correct way to concieve of this?
>
> On Sat, May 29, 2010 at 1:45 AM, Kevan Stannard <[email protected]
> >wrote:
>
> >
> > A simple option for you is to load all of your feature codes into a
> > structure then loop through your feature codes list and just pull the
> > feature code descriptions from the struct.
> >
> > On 29/05/2010 12:37 PM, "Bill Hartley" <[email protected]> wrote:
> >
> >
> > I am trying to display feature codes from a comma delimited list inside a
> > database.  Here is my setup:
> >
> > Table: Listings has a column called FEATURE_CODES and example of the data
> > in
> > this column is "B01,E09,E20,G12,J07"
> >
> > Then I have another table inside the same database called FeatureCodes
> the
> > data inside this table is arranged
> > FEATURE_CODE                     FEATURE_DESCRIPTION
> > B01                              Sold As Is
> > E09                              Frame and Stucco
> > and so on....
> > I need to display the feature description from the FeatureCodes table on
> > the
> > display page by reading the feature_codes from the listing table
> >
> > Any Suggestions?? Please!!
> >
> >
> >
> >
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334160
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to