wpdb_prepare with multiple or condition
I think your first partial code be this partial code: $wpdb->prepare( “SELECT * … from … WHERE ( post_title LIKE ‘%%%s%%’ or post_content LIKE ‘%%%s%%’ )…, $string, $string ); You have to have to pass the same number of arguments into the query as you specify (with %s) in it.