[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Coldfusion recursive categories fetching loop from Database!

Posted on 2014-04-06
2
Medium Priority
?
569 Views
Last Modified: 2014-04-06
When im running this script it is printing all my categories. i want when level change <UL> if tag should enable.

i know my logic is wrong looking that's why looking you help....

Please find below my query output Screen Shoot

<cfset catLevel = 0>

<ul id="menu">

<cfset getQuery = getAllCategories()>
<cfloop query="getQuery">

<cfif #getQuery.level# GT #catLevel#>
	<ul>
    <!--Sub-Category -->
</cfif>

	<li>
    
    	<a href="http://www.link.com/">
			<cfoutput>#Name#</cfoutput>
        </a>
        
	</li>

<cfif  #getQuery.level# GT #catLevel#>
	</ul>
    <!--Sub-Category -->
</cfif>
	
    	
   			 <cfset catLevel = #getQuery.level#>

    </cfloop>
	
    
</ul>

Open in new window

queryOut.jpg
0
Comment
Question by:xeondxb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Accepted Solution

by:
erikTsomik earned 2000 total points
ID: 39982046
take a look at this example I think that is exactly what you are looking for

http://www.dougboude.com/blog/1/2006/06/Recursive-Functions-in-ColdFusion.cfm
0
 

Author Closing Comment

by:xeondxb
ID: 39982178
yes i was looking this thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how the fundamental information of how to create a table.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question