I have this table:
-------------------------------------------------------------------------
| p_id | i_id | o_id | v_id |
--------------------------------------------------------------------------
|65 | 1 | 2 | 12 |
|65 | 1 | 4 | 9 |
|65 | 2 | 2 | 3 |
|65 | 2 | 4 | 9 |
|65 | 3 | 2 | 4 |
|65 | 3 | 4 | 10 |
How to query if I have p_id and 2 pairs of o_id and v_id ?
I need to know what is the i_id if I have this values:
p_id = 65,
o_id=2, v_id=3
o_id=4, v_id=9
I was thinking that if I try this:
$variantValues = VariantValue::where('p_id', 65)
->where(array(['o_id', 2], ['v_id', 3]))
->where(array(['o_id', 4], ['v_id', 9]))
->get();
will work....and then get from the first entry the i_id...but is not working.