Hi all
I'm stuck on this one. Here's the error:
Error Diagnostic Information
Cannot set default query to ADMAINCAT
A query by this name is not available at this time
The error occurred while processing an element with a general identifier
of (CFOUTPUT), occupying document position (46:4) to (46:30) in the
template file C:\web_pages\index_b.cfm
The specific sequence of files included or processed is:
C:\WEB_PAGES\INDEX_B.CFM
Here's the code:
<table border="1" width="100%">
<cfset colCount = 0>
<CFQUERY name="admaincat" datasource="foundry">
SELECT * from admaincat
ORDER BY admaincat
</CFQUERY>
<tr>
<CFLOOP QUERY="ADMAINCAT" >
<!--- <cfoutput query="ADMAINCAT"> ---> <!--- JBM: repeat code
recordcount times --->
<CFQUERY name="adcontent" datasource="foundry">
SELECT ID from adcontent WHERE admaincat = #admaincat.id#
</CFQUERY>
<CFQUERY name="adsubcat" datasource="foundry">
SELECT * from adsubcat WHERE admaincat = #admaincat.id#
</CFQUERY>
<cfoutput>
<td width="33%">
<A HREF="#admaincat.id#">
<font size="2">#ADMAINCAT#</font>
<font size="1"><br>#adsubcat.recordcount#</cfoutput>
<cfoutput QUERY="adsubcat">#adsubcat.adsubcat#<br></cfoutput> <!---
line 46 --->
(#adcontent.recordcount#)
</font>
</A>
</td>
<cfset colCount = colCount + 1>
<cfif colCount EQ 3>
</tr>
</tr><tr>
<cfset colCount = 0>
</cfif>
</cfloop>
<!--- </cfoutput> --->
</table>
The goal is a list of many categories with one or more subcategories
within each. I comment line 46, and the page runs ok. I've tried using
<cfloop> and <cfquery> on the parent loop, with the same result. Anyone
have an idea on how I can make this go?
Thanks in advance!
* john *
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists