you should have two tables: CATEGORIES and SITES
CATEGORIES:
----------------------
catID
parentCat
catName
SITES:
---------------------
siteID
siteName
catID (FK)
This layout has its benefits and its weaknesses. One benefit is that you
can nest infinitely and still have an efficient database, but a definite
weakness is that you never know how deep a category is and thus you must put
a query inside a conditional loop to retrieve the entire path to a site.
Another strength is that this DB layout works PERFECTLY with CFTREE, since
the Java takes care of visually displaying the heirarchy.
Bryan Love ACP
Internet Application Developer
[EMAIL PROTECTED]
-----Original Message-----
From: Michael Lugassy [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 23, 2001 11:55 AM
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