My goal is to make my app (store whatever) have the ability to have infinite
categories/subcategories. I'm aware that there may not be a great need to
go 10 subcategories deep, but if I make my app only go 2 deep and someone
wants 3 deep........ well you get the idea :)
I have done this sometime ago, and now im just wondering how bad the schema
is that I used :)
I have 1 Categories table with the following fields:
CategoryID (PK)
ParentCategoryID
CategoryName
.....other descriptive fields
Basically all top level cats would have a ParentCategoryID of 0, and
SubCategories would have a ParentCategoryID of its ParentCategory, and it
just continues through making infinite subcategories possible.
Then I either store the CategoryID in the products table or in a linking
table.
It currently is working out for me but, I have some query, <loop> query
</loop> scenarios which I'm sure is not a good practice. I'm also thinking
I could help those scenarios out with some Application.Structures that
define my category layout.
Well I thank you for taking the time to read my nonsense :) Any help for
the infinite category schema is greatly appreciated.
TIA,
Jeff
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists