title: multiple terms SQL with explode/implode and PHP PDO
body: <p>I have a search form that would like the users to search multiple terms. I'm currently using PHP PDO and I'm still learning... I was wondering if someone can tell me what I'm doing wrong here.</p>
  
  <pre><code>    $varSearch = @$_GET['dms']; 
      $varTerm = explode(" ", $varSearch);
      $termArray = array();
      foreach($varTerm as $term){
          $term = trim($term);
          if(!empty($term)){
              $termArray[] = "name LIKE '%".$term."%' OR tags LIKE '%".$term."%'";
          }
      }
      $implode = implode(' OR ', $termArray);
      $sql = $dbh-&gt;prepare("SELECT * FROM table WHERE ?");
      $sql-&gt;execute(array($implode));
  </code></pre>