I have a query that joins two tables. Category and
Items. I have the code that I am executing below also
after the desired output display.I have to display the
output in the following way:
Category 1
Item 1 Item 2
Item 3 Item 4
Item 5 Item 6
Category 2
Item 1 Item 2
Category 3
Item 1 Item 2
Item 3
Category 4
Item 1
Category 5
Item 1 Item 2
Here is the code that I have, which does not work
properly
<cfset CategoryNumber = 0>
<cfoutput query="GetCategoryAndItems"
group="CategoryID">
<cfset CategoryNumber = CategoryNumber + 1>
<table cellpadding=2 cellspacing=0 border=0
width="100%">
<tr colspan="2">
<td bgcolor="a0b8c8"><font face="arial,helvetica"
color="black" size=3><b>Category
#CategoryNumber#</b></td>
</tr>
<cfset ItemNumber = 0>
<cfoutput group="ItemID">
<cfset ItemNumber = ItemNumber + 1>
<cfif ItemNumber eq 1>
<tr>
</cfif>
<td>
Item #ItemNumber#<br>
</td>
<cfif ItemNumber eq 2>
</tr>
</cfif>
</cfoutput>
</table>
</cfoutput>
Any help is appreciated.
A.B.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists