[OT?] Database design
| From: | dems at sdimaps dot com | Date: | Thu, 01 Mar 2001 17:47:25 +0000 |
| Subject: | [OT?] Database design | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-7049@lists.php.net to get a copy of this message | ||
This is a little off topic... I am using PHP though :)
I am using PHP4 to interface with an InterBase 6.0 customer / order/
product database. I want to assign each product to a category (more than
one category in many cases), but I want to be able to add new categories
easily (without hardcoding them in PHP). Any suggestions/criticisms about
this database design:
Products Table:
ProductID,
ProductName,
...
ProductCategory Table:
rProductID references products(ProductID),
rProductCatID references ListProductCat(ProductCatID);
ListProductCat Table:
ProductCatID,
Description;
I can't think of a better way to do it. This setup allows me to have more
than one category for each product and I can add new categories by adding
a new field to the ListProductCat table. I could change the rProductCatID
field in the ProductCategory table to restrict the values to a list, but
then I have to change the table structure when I want to add a new
category.
Any ideas?
TIA.
Daniel Ems
Spatial Data Integrations
Louisville, KY
502.568.2591