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>
Copy link to clipboard
Copied
I'm sorry, but I don't clearly understand what you are tyring to do OR what problem you are having doing it?