I have a problem with mysql query. for a cuople days I cannot solve it.
URL params ?a=1&b=2&c=3
Structure:
attr_id value_id
query:
SELECT DISTINCT `product_id`
FROM `products_attr_val`
WHERE
(`attr_id` = '".$searchqueryArray2[0]."' AND `value_id` = '".$searchqueryArray2[1]."')
OR (`attr_id` = '".$searchqueryArray2[0]."' AND `value_id` = '".$searchqueryArray2[1]."')
but the problem is that if a=12&b=10
and if there is a product with atribute 10 or atribute 12 it shows. I need to show products with a=12 and b=10.
Whats wrong?
Thanks for help.