the setup from the hierarchical table should be something like this..

Parent_ID, ID, Any other fields you need

I set Parent_ID to zero if it is the top level.  All the children of the parent have 
the Parent_IDs
"ID" value as their Parent_ID...so...

Parent:
ID 1 Parent_ID 0
Children:
ID 2 Parent_ID 1
ID 3 Parent_ID 1
Childs Children:
ID 4 Parent_ID 2
ID 5 Parent_ID 2
ID 6 Parent_ID 3
etc. to infinity and beyond!

but of course you're stuck with recursive queries or looping over queries etc.

HTH

Bryan Stevenson
VP & Director of E-Commerce Development
Electric Edge Systems Group Inc.
p. 250.920.8830
e. [EMAIL PROTECTED]
---------------------------------------------------------
Macromedia Associate Partner
www.macromedia.com

----- Original Message -----
From: "Richard Meredith-Hardy" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, January 18, 2002 10:33 AM
Subject: hierarchical database.....


> I'm having a job getting my head around this one.
>
> Essentially I am trying to establish a hierarchical structure in a
> database in such a way one is not having to do loads of recursive
> queries to return the path between one item and another in the tree...
> is this even possible?
>
> One idea someone threw at me was XML.... well I understand WDDX, but I
> don't understand the principles of using XML as an actual database.
> Could this solve my problem?
>
> All ideas & suggestions welcome!
>
> --
> Regards;
>
> Richard Meredith-Hardy
> -------------------------------------------------------------
> [EMAIL PROTECTED]
> 
______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
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

Reply via email to