I have the following mysql query in php:
$results = $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata' AND meta_value LIKE '%details%'");
However I want the query to be dynamic by changing the LIKE
section of the query. Instead of:
LIKE '%details%'
I want to put a variable in there:
LIKE '% $format %'
where $format is a string.
Everything I have tried thus far has failed.
Whats the proper way to do this?