title: zend db select like wildcards
body: <p>was trying to find some information about "like" clause in selects with zend db, but had no success.
  The problem is that it's not clear how to use the wildcard "%" near LIKE clause</p>
  
  <p>The bad idea, which I've used initially and which is recommended in hundreds of places on the net is</p>
  
  <pre><code> $db-&gt;select()
      -&gt;where('text LIKE "%'.$query.'%"');
  </code></pre>
  
  <p>I guess, that the correct answer would be something like:</p>
  
  <pre><code> $db-&gt;select()
      -&gt;where('text LIKE ?', $query);
  </code></pre>
  
  <p>but there is no wildcards used</p>
  
  <p>I've tried several solutions, but they all don't seem to work:</p>
  
  <pre><code>$db-&gt;select()
      -&gt;where('text LIKE ?', '%$query%');
  $db-&gt;select()
      -&gt;where('text LIKE ?', '%{$query}%');
  </code></pre>
  
  <p>Could anyone please point to the documentation, or provide a good solution for this?</p>
  
  <blockquote>
    <p>The second argument to the where() method is optional. It is a value to substitute into the expression. Zend_Db_Select quotes the value and substitutes it for a question-mark ("?") symbol in the expression.</p>
  </blockquote>
  
  <p>doesn't tell enough</p>