P
P
pizhqlho2018-02-16 13:12:13
MySQL
pizhqlho, 2018-02-16 13:12:13

How to properly store related products?

I have an entity Product. The product can be a normal product, or it can be one that is not visible anywhere except for the "You will also like" block (i.e. it can only be shown in this block, and nowhere else ).
I store it like this:
products
id
name
...
product_type_id
product_types
id
name (Regular Product, Related Product) - only shows up in the admin
, am I storing it right? I also have an option to create a table of related products with a single column product_id, all products that are stored there are considered related. Which option to choose, the first or the second?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stimulate, 2018-02-16
@pizhqlho

I would make a product table and a separate link table where I would store product_id, extra_product_id

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question