I believe you are talking about the nested set model, Steve's tutorial is
below (And I didn't have to login to get it)
http://www.secretagents.com/tools/freeviewlets/index.cfm?category_id=20&show
viewlets=1
Steve has a ton more tutorials at:
http://www.secretagents.com/tools/viewlets
You can find more about the Nested Set model in Joe Celko's book "SQL For
Smarties". Its a great book, I recommend it to anyone who writes SQL. ISBN:
1-55860-323-9
Although the nested set model is a great way to store hierarchal trees, in
very simple cases you may just consider using the ID/ParentID model. The
nested set model has great advantages when you need to display a hierarchal
tree on a web site, like a site map for instance.
Pete Freitag
CFDEV.COM
ColdFusion Developer Resources
http://www.cfdev.com/
-----Original Message-----
From: Michael Lugassy [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 23, 2001 4:07 PM
To: CF-Talk
Subject: Re: Me Vs. Complexed Table Design
I didn't find secretagents' tutorial,
the site looks alot like hotmail, I can't get in without becoming
a member, or what? :)
I would like to take a look at it before implement the alternative.
Michael.
----- Original Message -----
From: "Norman Elton" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, July 23, 2001 8:07 PM
Subject: Re: Me Vs. Complexed Table Design
> Sounds like you're trying to implement a tree (it's formal
> name). For a good lesson, check out Steve Nelson's free
> tutorial at www.secretagents.com. The concepts somewhat
> complicated, so you might have to read it a few times, but
> works well.
>
> As an alternative, you could just keep track of the
> following for each record:
>
> 1. ID
> 2. Name
> 3. Parent ID
>
> Where Parent ID is the parent of the current record. This
> makes it hard to build a link from a record (known as a
> node) back to the root of the tree. You'd probably have to
> loop over a CFQUERY, which gets nasty.
>
> Hope this helps
>
> Norman
>
> Quoting Michael Lugassy <[EMAIL PROTECTED]>:
>
> > We have a big index of sites, each site belongs to a
> > certain "main category"
> > and a sub_category.
> >
> > Certain sites are nested inside 2,3 and even 5
> > sub-sub categories.
> >
> > How can I create a category(ies) table(s) that will
> > store the catID and catNAME?
> > (each category/subcategory ID takes 2 places xx)
> >
> > Here is an Example:
> >
> > The Yahoo! site, for example is in:
> >
> > Computers and Internet > Internet > Internet and
> > Search Engines > Directories > World
> >
> > Where Computers and Internet = 24 00 00 00 00
> > (I've added space just to explain what I need)
> > Internet = 24 11 00 00 00
> > Internet and Search Engines = 24 11 92 00 00 00
> > Directories = 24 11 92 83 00 00
> > World = 24 11 92 83 00
> >
> > Ofcourse there could be more then one sub-sub
> > category named "world"
> > and the sub-sub count varies.
> >
> > Any help, tips, something?
> >
> > Michael.
> >
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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