Just had a read of the code, it does 2 queries for every parent in the database? Did I read that correctly?
-----Original Message----- From: Emmet McGovern [mailto:[EMAIL PROTECTED] Sent: 26 October 2005 15:49 To: CF-Talk Subject: RE: Recursion anyone? Here's a use of treeview.nets treeview with recursion. http://fullcitymedia.com/apps/treeview You can download the code here. http://fullcitymedia.com/apps/treeview/treeview.zip Take a look, might be similar to what you're looking for. Emmet -----Original Message----- From: Stephen Whiteley [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 26, 2005 10:30 AM To: CF-Talk Subject: Re: Recursion anyone? Thanks Kerry I'm starting to understand, got no experience of cfscript but it seems a lot like actionscript. Unfortunately I've tried to run the code and I'm getting the following error. Context validation error for tag cfscript. The start tag must have a matching end tag. An explicit end tag can be provided by adding </cfscript>. If the body of the tag is empty you can use the shortcut <cfscript .../>. This is the exact code.... <cfquery datasource="#DSN#" name="getAllCategories"> SELECT itemid,parentitemid,adcategoryname FROM tblAdvertTypes </cfquery> <cfscript> variables.inst.menuqry = getAllCategories; function buildmenu(currentid,depth){ var i=0; for(i=1; i lte parentitemid.menuqry.recorcount; i=i+1){ if(variables.inst.menuqry.parentitemid[i] eq arguments.currentID) writeoutput(repeatstring(">",arguments.depth)&variables.menuqry.adcategoryna me[i]&"<br>"); buildmenu(variables.inst.menuqry.itemid[i],arguments.depth+1); } } buildmenu(10,0) </cfscript> Steve ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222355 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54