I am trying to extract multiple IDs from wp_postmeta
table, with double WHERE condition to be checked in two records:
WHERE (meta_key = 'leather' AND meta_value = 'calf') -> First record
AND
WHERE (meta_key = 'gender' AND meta_value = 'woman') -> Second record
In a shop selling leather goods I need to extract products (based on postmeta) in CALF (leather) for WOMAN (gender).
The condition must be checked on two records with the same ID, as shown in the picture.
I have tried about a dozen different solutions from various posts but with no result until now.
Thank you.
View example in wp_postmeta
table: