title: how to write correct query in wpdb
body: <p>what is wrong in my query?</p>
  <pre><code>$query = &quot;SELECT * FROM wp_posts WHERE post_status = 'publish' AND post_title LIKE '%&quot;.$searchKey.&quot;%'&quot;;
  </code></pre>
  <p>In this case, query work fine:</p>
  <pre><code>SELECT * FROM wp_posts WHERE post_status = 'publish' AND post_title LIKE '%hello%'
  </code></pre>
  <p>When i try add variable to query, it doesn't work</p>
  <pre><code> public function search_result($searchKey)
    {
      $query = &quot;SELECT * FROM wp_posts WHERE post_status = 'publish' AND post_title LIKE '%&quot;.$searchKey.&quot;%'&quot;;
      return $this-&gt;wpdb-&gt;get_results($query);
    }
  </code></pre>