1 Reply Latest reply on Jul 8, 2010 11:27 AM by ilssac

    Equality Statement : Multiple possiblities

    TheScarecrow Level 1

      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


      <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[i]=StructNew()>

                          <cfset resourcecardArray[i].title = title>

                           <cfset resourcecardArray[i].url = url>

                           <cfset resourcecardArray[i].ID = ID>

                           <cfset resourcecardArray[i].enddate = end_date>

                           <cfset resourcecardArray[i].pub_num = pub_num>

                           <cfset resourcecardArray[i].mod_date = mod_date>