Answer the question
In order to leave comments, you need to log in
Intersection of MySQL Set Groups
Please help:
There is a table of goods:
| id | caption |
| 1 | first |
| 2 | second |
| 3 | third |
There is also a table of parameters combined into sets
. Sets:
| id | set_name |
| 1 | set1 |
| 2 | set2 |
| 3 | set3 |
Options:
| id | set_id | params |
| 1 | 1 | 2014 |
| 2 | 1 | 2013 |
| 3 | 2 | param1 |
| 4 | 2 | param2 |
| 5 | 2 | param3 |
| 6 | 3 | param1_3 |
Well, actually the table of links:
| id_item | id_param |
| 1 | 1 |
| 1 | 3 |
| 2 | 1 |
| 2 | 4 |
| 2 | 5 |
| 3 | 2 |
| 3 | 3 |
| 3 | 6 |
What is:
At the input there is a multidimensional array, with nested parameters sorted by sets:
$forSelect = array(
'set1' => array( '1' , '2' ),
'set2' => array( '3' , '5' ),
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question