title: SQLSTATE[HY093]: Invalid parameter number
body: <p>I am having some trouble getting my search query to work. I get this error. </p>
  
  <p>SQLSTATE[HY093]: Invalid parameter number</p>
  
  <p>Here's my code.</p>
  
  <pre><code>&lt;?php
  try{
      $sql = "SELECT * FROM `character` WHERE `name` LIKE :search  OR `play` LIKE :search";
      $query = $db-&gt;prepare($sql); 
      $query-&gt;execute(array(':search' =&gt; strip_tags($_POST['search'])));
      $result = $query-&gt;fetchAll(PDO::FETCH_ASSOC);
      foreach($result as $row){
              $name = $row['name'];
              $gender = $row['gender'];
              $id = $row['id'];
              echo "&lt;tr&gt;
              &lt;td&gt;". $name ."&lt;/td&gt;
              &lt;td&gt;". $gender ."&lt;/td&gt;
                  &lt;td&gt;&lt;a href='characterbio.php?id=". $id ."'&gt;". $name ."'s Bio Page&lt;/a&gt;&lt;/td&gt;
                  &lt;/tr&gt;";
      }
  }catch(PDOException $e){
       die($e-&gt;getMessage());
  }
  ?&gt;
  </code></pre>
  
  <p>Please help me out. Thanks!</p>