Code: Select all
$query = "INSERT INTO orders VALUES ('order_id','$item1','$item2','$item3','$subtotal','$shipping','$total')";What I really need to do is post each product ordered to it's own table row...in other words, to create a row entry for each item ordered with fields like :
order_id | item_num | item_descr | item_qty | item_price | item_total
this would give me a table that reads something like:
101 | paint | 5 gallon pail | 2 | 25.00 | 50.00
101 | brush| 2 inch broad | 2 | 10.00 | 20.00
101 | paint | 1 gallon pail | 3 | 12.50 | 37.50
(obviously I would have to include additional fields to those above)
can this be done?
I'm wondering how to write the INSERT INTO query so that it posts each item ordered across the row, then moves to the next row to enter the next item ordered, for as many items ordered?
hope this makes sense..
any/all help appreciated.
thanks in advance.
mc