Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Advice needed
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Advice needed

 Post Reply Post Reply
Author
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post Topic: Advice needed
    Posted: 27 November 2003 at 8:16pm

I just want to seek some advice before I go further.

The scenario is like that. I have 2 tables.

1. Company
2. Product Category

One company can have one or more product category.

I have a form for product category. This form is just to add and maintain one field which is product category.

I have a form for company. This form is to key in company details like company name, address, phone etc and there is a button to save and go to next form. Next form is retrieve from Product Category table. And next to every product category there is a checkbox (view attachment - http://www.htmlforums.com/attachment.php?s=&postid=20182 9). My existing company got a field named productcategory. And when I save it, the productcategory field in Company table will have an appended value. Eg, 1,2,5,6 (assuming all these number is product category id).

My question is if let's say I ammend the product category either delete or modify it, this means there will no longer synchronize with productcategory field in company table.

So, I wonder in this situation what's the best solution. One company can have one or more product category and this product category is not fix.

Back to Top
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2003 at 9:34pm

It's ok, I think I got it. I just need to create another table and this table I name is Cust_ProductCat. In this table there will be CustomerID and ProductCatID and when I edit or delete my product category, two tables (ProductCat and Cus_ProductCat) will make changes together.

If anyone lost it or can't understand, just ignore my post. Perhaps I just want to document a little things here.

Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2003 at 9:37pm
Give companies a unique ID and

1) add a CompanyID field to the ProductCategory table, so every ProductCategory is linked to a Company

OR

2) Create another table that stores the CompanyID with a ProductCategoryID to associate ProductCategories with Copanies.

Use 1 if each product category is associated with only one company. Use 2 if a product category can be associated with more than one company.
Back to Top
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2003 at 11:10pm
Thanks, IJamal. I thought no one can understand that but you did. My reply to self is something like your second method.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.