title: php pdo sql query Error : 1064 with LIKE
body: <p>My PDO query is throwing an error </p>
  
  <blockquote>
    <p>42000 1064 You have an error in your SQL syntax</p>
  </blockquote>
  
  <pre><code>$sql = "SELECT * FROM {$this-&gt;config-&gt;__get('table_medicine')} WHERE patient_id = ? AND medicine LIKE %?%";
      $query = $this-&gt;dbh-&gt;prepare($sql);
      $data = array($patient_id, $medicine);
      $response = $query-&gt;execute($data) or die(implode(" ", $query-&gt;errorInfo()));
  </code></pre>
  
  <p>Can someone see what am I doing wrong? </p>