Custom WP query on multiple meta_keys and meta_values
-
Hi all
Am trying to query multiple meta_keys & meta_values, but not getting the query right.
$queryall = "SELECT DISTINCT(post_id) FROM wp_postmeta WHERE (meta_key = 'mb_category' AND meta_value = 'To Let') ORDER BY post_id DESC";
$queryall = "SELECT DISTINCT(post_id) FROM wp_postmeta WHERE (meta_key = 'mb_property-type' AND meta_value = 'id119') ORDER BY post_id DESC";
Need to combine the two queries.
Do i need to do an inner join or left join… Can someone please assist or advise?Regards,
Charl
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Custom WP query on multiple meta_keys and meta_values’ is closed to new replies.