D
D
Dmitry STEM2017-08-29 14:23:46
SQL
Dmitry STEM, 2017-08-29 14:23:46

How to properly exclude certain products from the selection?

It is necessary to remove from the list of games those that are already in the Steam account. The array of games on the account is written to the database via serialize. Each game has its own id. How to remove from the selection the games in which the id matches the one in the serialized array?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav B, 2017-08-29
@STEM1

The array of games on the account is written to the database via serialize.

In a situation where you need to perform some kind of action on the data, writing them in one serialized field is a stupid plan.
many-to-many

A
Alexander Lysenko, 2017-08-29
@LysenkoSasha

SELECT id FROM table WHERE id NOT IN (SELECT `id` FROM `table2`)
after not in make a query to the user's table, for example, with his games

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question