Try this:

Category_Table
--------------
Category_ID
Category_Name
Category_Parent


from here,  you might have data like the following:

ID      Name                                    Parent
-------------------------------------------
1       Computers And Internet          0
2       Internet                                1
3       Internet and Search Engines     2
4       Directories                             3
5       World                                   4
6       Programming                             1
7       HTML                                    6

this would build your structure, and add Computers And Internet >
Programming > HTML.

If Parent is 0 then you assume it is a root item, otherwise, parent points
to the category above.
Builds a nice tree structure, and supports a LARGE number of sub-levels.

Hope that helps.

Shawn Grover

-----Original Message-----
From: Michael Lugassy [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 23, 2001 12:55 PM
To: CF-Talk
Subject: Me Vs. Complexed Table Design


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

Reply via email to