title: Warning : SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
body: <p>I know this question has been answered many time. I have seen the anwseres but still not able to understand what is going wrong. here the piece of code - </p>
  
  <pre><code>$var =$_POST['feature'];
  
      $status = 'passed';
      $allTest = $conn-&gt;prepare('SELECT SUM( IF( STATUS = :status, 1, 0 ) ) passed_count FROM tooldata WHERE testCase REGEXP :var GROUP BY family ORDER BY family' );
      $allTest-&gt;bindValue(":var", "^$var", PDO::PARAM_STR); 
      $allTest-&gt;execute(array(':status' =&gt; $status));
  
      while($row = $allTest-&gt;fetch(PDO::FETCH_ASSOC))
          { 
          foreach($row as $key) 
              {
                  $totalTestPassed[] = $key;
              } 
          }
              print_r($totalTestPassed);
  </code></pre>
  
  <p>I get this error on line - <code>$allTest-&gt;execute(array(':status' =&gt; $status));</code></p>
  
  <p>please guide me regarding why I am getting this error.</p>