K
K
Knyashshsh2018-02-24 23:49:51
MySQL
Knyashshsh, 2018-02-24 23:49:51

How to store the list of ordered goods?

Let 's say the user made an order and in the "orders" table there is
-order
id -order
amount -order date
etc.
If there was one product, then its id would be stored.
But what to do if there are several products in the order? And what if I ordered 2 pieces or more of one product? How to organize it correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2018-02-25
@fyapy

A table purchases(purchases) is created with the fields:
5a91daa9ba0d0598154064.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question