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

Equality Statement : Multiple possiblities

Community Beginner ,
Jul 08, 2010 Jul 08, 2010

Copy link to clipboard

Copied

I have a query see below. Then I run the query results through a loop putting it into an array.  The problem is that is it s based on category and category is not just one thing it can be multiple items.The problem is when the loop runs it groups the query results by category... EX: if the category is a Manual it puts the query results into Manual..

What I dont know how to do is if the results has a category of Manual and say Card.  Right now if have the the loop checking to see if the category equals something specific.  Does anyone know how I might fix this?

<CFQUERY name="projectresources" datasource="4h_projects">

     SELECT *

     FROM resource

     WHERE proj_key=#url.proj_key# AND  (category = '#url.category#' OR category Like '%#url.category#%' OR category Like '%#url.category#' OR category Like '#url.category#%')

     ORDER by ID

</CFQUERY>

<CFIF projectresources.recordcount GT "0">

        <cfset resourcecardArray = Arraynew(1)>

        <cfset e = 0>

        <cfset resourcecardArray = Arraynew(1)>

        <cfset g = 0>

        <cfloop query="projectresources">

              <CFIF projectresources.category EQ 'Form' >

                    <cfset resourcecardArray=StructNew()>

                    <cfset resourcecardArray.title = title>

                     <cfset resourcecardArray.url = url>

                     <cfset resourcecardArray.ID = ID>

                     <cfset resourcecardArray.enddate = end_date>

                     <cfset resourcecardArray.pub_num = pub_num>

                     <cfset resourcecardArray.mod_date = mod_date>

               </cfif>

          </cfloop>

</cfif>

TOPICS
Advanced techniques

Views

334

Translate

Translate

Report

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
Valorous Hero ,
Jul 08, 2010 Jul 08, 2010

Copy link to clipboard

Copied

LATEST

I'm sorry, but I don't clearly understand what you are tyring to do OR what problem you are having doing it?

Votes

Translate

Translate

Report

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
Documentation