Hi I have a query which retrieves Some data. I want to display that data considering some conditions in different div tags. Now my question is, I am doing this by looping the query once and getting the data in three different structs and using these structs while displaying. Is this a good approach or looping through the query everytime in each div to check the condition is the rirht approach ?
<tr >
<td >
features:
</td>
<td >
<cfloop query="getAttributes">
<cfif getAttributes.type_id EQ 1>
#getAttributes.seat#<br>
</cfif>
</cfloop>
</td>
</tr>
<tr>
<td >
Disclosures:
</td>
<td >
<cfloop query="getAttributes">
<cfif getAttributes.type_id EQ 2>
#getTicketAttributes.seat#<br>
</cfif>
</cfloop>
</td>
</tr>
Or can i use the below approach
seatStruct
disclosureStruct
<cfloop query="getAttributes">
<cfif getAttributes.type_id EQ 1>
Insert seatStruct
<cfelseif getAttributes.type_id EQ 2>
insert disclosureStruct
</cfif>
Now use these structs to display