I want to execute a query like this:
$wpdb->prepare( "SELECT * ... from ... WHERE ( post_title LIKE '%%%s%%' or post_content LIKE '%%%s%%' )..., $string );
If I do the query with only one condition it works:
$wpdb->prepare( "SELECT * ... from ... WHERE ( post_title LIKE '%%%s%%' )..., $string );
What is the error in my first query?
I think your first partial code be this partial code:
You have to have to pass the same number of arguments into the query as you specify (with %s) in it.
this worked from
credits user998163