i am making a webstore and it has a table that has all the items in it. like each item has its own row in the table called like "items" or something right and each column is specific to all items. but im lost what to do with orders. i come to a dead end when i think of having a table called "orders" when someone places an order it would update that table and there would be columns like item 1, item 2, item 3 which is not specific to all order because not all orders are going to be the same amount of items. SO I DRAW A BLANK ON WHAT TO DO. now do u know a good way to do orders? im really lost like when a customer places an order. LOL what do i insert into the database like whats the layout of the table(s) and stuff. please any ideas hlp me now im working on it
Recommended Answers
Jump to PostYou'd have a table orders, which has order specific columns like #, date, etc. The orders are linked to items in yet another (link-)table, containing an order-id and item-id's.
Jump to PostSomething like this. Orders-Products is a link table that connects orders to products. So based on the order-id you can determine which products are in it.
ORDERS ORDERS-PRODUCTS PRODUCTS id <-- order-id id date product-id --> title customer-id product-count price etc... etc...
To get an order with …
Jump to PostCorrect.
Jump to PostIt depends on what you use it for. In some of my apps I have columns there like: order-status, delivery-method, shipping-costs, payment-method, coupon-code, .... and of course a link to the customer detail table, even a link to a shipping and billing address.
All 14 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.