This is a discussion on "Nightmare product/Category structure" within the Databases section. This forum, and the thread "Nightmare product/Category structure are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Nightmare product/Category structure
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Nightmare product/Category structure
I'm using Access to create a category structure for an e-commerce site.
Unfortunately, this site has a very confused product/category structure and its twisting my melon to create a database table structure to handle it. The site has 7 Top-level categories. Under *only* 2 of those top-level categories I need to create sub categories. I'm used to simpler systems where *every* top level category has its own sub category structure, which was easier to code. Essentially, how do I code the category/subcategory/product tables so I can indicate for each product where it sits in the structure? |
|
|
|
||||
|
Hi D3mon.
Essentially, for each category you could have a parent category field. Obviously this means any category can have sub cats as deep as you like. I suggest limiting the functionality for the two you need in code only.
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
Yeah, for these I of course have an id number for a each category and a field like cparent which can be filled with the id number of the parent category.
Then in the products table each product has a field that point to the id of the category the product is in. When building your product tree I think I usually use a recursive function to check for sub categories if you're familiar with those (functions that call themselves). |
![]() |
| Tags |
| nightmare, productcategory, structure |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [solved] Menu Nightmare | saltedm8 | Web Page Design | 3 | Apr 14th, 2008 22:35 |
| [SOLVED] Nightmare query | AdRock | Databases | 0 | Nov 17th, 2007 15:50 |
| new category? | alexgeek | Webforumz Suggestions and Feedback | 3 | Sep 26th, 2007 17:28 |