Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamic menu is only showing the first link

Status
Not open for further replies.

dunskii

Programmer
Sep 14, 2001
107
AU
Hi there,

I am trying to create a dynamic menu. I'm not getting any error messages but only the first link and image is being shown.

Heres the code i'm using.

<cfquery name=&quot;getCategory&quot; datasource=&quot;dunskii&quot; dbtype=&quot;ODBC&quot;>
SELECT prod_category.prod_cat_id AS catID, prod_category.name AS catNAME, prod_site_cat.prod_cat_id, prod_site_cat.site_id, site_details.site_id AS siteID, site_details.postcode AS postCODE FROM prod_category INNER JOIN ( prod_site_cat INNER JOIN site_details ON prod_site_cat.site_id = site_details.site_id ) ON prod_category.prod_cat_id = prod_site_cat.prod_cat_id WHERE site_details.site_id = #ID#
</cfquery>
<TABLE BORDER=&quot;0&quot; align=&quot;center&quot;>
<cfoutput query=&quot;getCategory&quot;>
<CFIF CurrentRow MOD 1 IS 1>
<TR>
</CFIF>
<TD width=&quot;50%&quot; align=&quot;center&quot; nowrap><a href=&quot;category.cfm?ID=#catID#&quot;><img scr=&quot;../images/cat_buttons/#postCODE#-#siteID#-#catNAME#-1.gif&quot; border=&quot;0&quot;>#catNAME#</a></TD>
<CFIF CurrentRow MOD 1 IS 0>
</TR>
</CFIF>
</cfoutput>
<CFIF getCategory.RecordCount MOD 1 IS NOT 0>
<CFSET ColsLeft = 1 - (getCategory.RecordCount MOD 1)>
<CFLOOP FROM = &quot;1&quot; TO = &quot;#ColsLeft#&quot; INDEX = &quot;i&quot;>
<TD> </TD>
</CFLOOP>
</TR>
</CFIF>
</TABLE>

cheers

d
 
Just to check -- how many records are being returned from your query? Turn on your sql debugging or do a
<cfoutput>#getCategory.recordcount#</cfoutput>

If it is only showing &quot;1&quot; then it has to do with the query
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top