Guys,
I've hunted through the posts and found nothing about this, I hope someone can help. Please forgive me if gross ignorance is the root cause of the problem!
Most of the shopping cart examples that I have seen use a single table to hold the entire catalog of items for sale using the part # for the primary key. Then you simply stuff the part # for the item into the cart. This doesn't work very well for my application as all of the items for sale are in different tables and I think they need to stay in different tables for good normalization.
I think an example might be helpful: I want to sell sanwiches online (not really!) and I want the user to be able to build his own sandwich: pick his bread, filler and condiments. So there is a table for breads, one for fillers and one for condiments (because I have different options for each (ie toasted bread) and I want to relate them to one another (not offer pickles as a condiment if you picked peanutbutter and jelly as your filler). But if I just insert the part number for each item into the cart, how do I reference back to the tables for the descriptions and other items? Each table will be different and have different column
names.
I hope this makes sense and that someone can shed some light on how I should set my database up.
Thanks!
Jeff Driskill
I've hunted through the posts and found nothing about this, I hope someone can help. Please forgive me if gross ignorance is the root cause of the problem!
Most of the shopping cart examples that I have seen use a single table to hold the entire catalog of items for sale using the part # for the primary key. Then you simply stuff the part # for the item into the cart. This doesn't work very well for my application as all of the items for sale are in different tables and I think they need to stay in different tables for good normalization.
I think an example might be helpful: I want to sell sanwiches online (not really!) and I want the user to be able to build his own sandwich: pick his bread, filler and condiments. So there is a table for breads, one for fillers and one for condiments (because I have different options for each (ie toasted bread) and I want to relate them to one another (not offer pickles as a condiment if you picked peanutbutter and jelly as your filler). But if I just insert the part number for each item into the cart, how do I reference back to the tables for the descriptions and other items? Each table will be different and have different column
names.
I hope this makes sense and that someone can shed some light on how I should set my database up.
Thanks!
Jeff Driskill