G
G
goodlike_by2020-02-21 17:48:55
Laravel
goodlike_by, 2020-02-21 17:48:55

How to generate a search query for has many?

Hello everyone,

there are two tables:

Products
1. id
2. name
3. description

And conditional Options
1. id
2. product_id
3. name
4. value

Please help us form a query in which we select fields from the Products table that have several rows from The options match the request.

"Conditionally select all of the Products, where Options A = 10 and B = 12"

Something I'm stuck on this, or tell me where you can read about it, I'm very grateful in advance for help

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question