title: Is it possible to bindParam WHERE name like %:name%
body: <p>I'm testing a small search feature:  </p>
  
  <p>But I've come across an error that I cannot seem to solve. You can see the PDO query here: </p>
  
  <pre><code>$search = "test1"; //later to be changes to $_POST ['search'];
  
  $sql = "SELECT id, name FROM clients WHEE name like %:name% order by id LIMIT 5";
  $stm = $db-&gt;prepare ( $sql );
  $stm-&gt;bindParam ( ":name" , $search);
  $result = $stm-&gt;execute ();
  </code></pre>
  
  <p>As you can see, I'm trying to bind the parameter <code>%:name%</code> from my query, but I don't know if that's actually possible?</p>
  
  <p>I receive the error: </p>
  
  <blockquote>
    <p>Uncaught exception 'PDOException' with message 'SQLSTATE[42000]:.....</p>
  </blockquote>
  
  <p>And I can see in the error that '' has been put around test1 %'test1'% </p>
  
  <p>Is what I'm trying possible, or do I need to do something like this?</p>
  
  <pre><code>$query = "SELECT id, name FROM clients WHEE name like :name order by id LIMIT 5";
  
  $sql-&gt;execute(array(":name" =&gt; "%" .$search . "%"));
  </code></pre>