That's about how I would do it.

You could also do a join in your SQL with the ItemID-CategoryID table and
your products table to return all the information at once, instead of doing
it in two steps as you have described.  But in general I think this is a
good way to do it.

Byron
----- Original Message -----
From: Seth Petry-Johnson <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 10, 2000 2:25 AM
Subject: Products in multiple categories


> List,
>
> I'm working on an e-commerce site where the client has requested that a
> product should be able to exist in multiple categories.  In other words,
> certain products should be displayed when a user takes a number of
different
> drill down paths.
>
> They want to do this at the product level rather than at the category
level.
>
> I haven't tackled this situation before, and I am looking for suggestions.
> I have come up with the following solution, although I'm not sure how
viable
> it is:
>
> I would create a sort of lookup table that contained all of the item and
> category pairings.  This table would have two fields: ItemID and
CategoryID
> (where the combination of both would be the PK value).  To find all
products
> in a category I would run a query against the category ID in this table,
and
> then feed the resulting ItemIDs to a query pulling data from the product
> information table.
>
> It would also be easy to retrieve a list of CategoryIDs for a given item
by
> querying against the ItemID value in the lookup table, and I could enforce
> referential integrity in the DB to ensure that only valid data is in this
> table.
>
> Can anyone shed some light on the strengths/weaknesses of this idea, or
> perhaps provide a better solution?
>
> Many thanks in advance,
> Seth Petry-Johnson
> Argo Enterprise and Associates
>
> --------------------------------------------------------------------------
----
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>


------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to