Nightmare product/Category structure

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.



Go Back   Webforumz.com > Main Forums > Program Your Website > Databases

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old May 5th, 2005, 15:33
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
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?

  #2 (permalink)  
Old May 5th, 2005, 15:44
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
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
  #3 (permalink)  
Old May 5th, 2005, 16:39
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
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).
Closed Thread

Tags
nightmare, productcategory, structure

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 06:36.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43