I'm wanting to expand on the following query to look at multiple meta_key and meta_value values that have been created with the Advanced Custom Fields (ACF) plugin.
e.g.
meta_key 'colours_%_colour' meta_value 'Red'
AND
meta_key 'colours_%_design_style' meta_value 'Plain'
This is what I have so far which I came across on the ACF Documentation (https://www.advancedcustomfields.com/resources/querying-the-database-for-repeater-sub-field-values/)
It successfully retrieves results with the color (sub field) of red.
$rows = $wpdb->get_results($wpdb->prepare(
"
SELECT *
FROM {$wpdb->prefix}postmeta
WHERE meta_key LIKE %s
AND meta_value REGEXP %s
",
'colours_%_colour', // meta_name
'red' // meta_value
));
Thanks,
Matt.