Answer the question
In order to leave comments, you need to log in
How to store the quantity of goods?
Hello!
There is a table with products
products
- id
- name
And a table with colors
colors
- id
- name
- img
Some products may have several colors. And others may have no color at all. Where and how to store the quantity of such goods? That is, the quantity of goods of a certain color and the quantity of goods without color. I would like to keep everything in one place.
Thank you!
Answer the question
In order to leave comments, you need to log in
Create 3rd table product_colors:
id
product_id
color_id
It would be wrong to do so.
Why, it is said here: https://habrahabr.ru/post/193756/
That is, the quantity of goods of a certain color and the quantity of goods without color
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question