hi.

the easiest way is to have
an order table:
(orderID, customer, address, etc., etc.)
a item table:
(itemID, description, price, etc.etc.)
and an orderItems table:
(orderID, itemID)

this way you can
select i.description, i.price
from order o,
        item i,
        orderItems oi,
where o.orderID = 1 and
        o.orderID = oi.orderID and
        oi.itemID = i.itemID

or something like that.
you could replace the customer/address columns in order with a customerID
referencing a customer table as well...

-ravi.


-----Original Message-----
From: Jeff Jones [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 18, 2001 3:00 PM
To: [EMAIL PROTECTED]
Subject: Design question


I have a design problem I was hoping some of you could help me out with.  I
am writing a shopping
cart system (as if there wasn't enough already) and I have one problem that
has me stumped.

A person can order more than one item of course.  So let's say they order a
kite and some string.
Both of these have product numbers, and the overall order has an order
number.  I am trying to
figure out how to design a table ( or tables ) so I can keep track of the
different products that
are ordered during one order.  I need to keep track of the product number,
quantity, and price
for that product.  For instance:

Order #                 Products
-------------                      ------------------
11111                   222 : Qty 1: 12.00 # 333 : Qty 2 : 14.00

That is order number 11111 and that person ordered one of product # 222 @
12.00 and 2 of product # 333 @14.00.

I would appreciate any assistance any of you might be able to offer.  If I
wasn't clear enough, let
me know and I will try and explain it better.

Thanks.

Jeff Jones

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to