title: PDO Invalid parameter num
body: <p>I have created this function to insert data into database and it does it, but it throws a warning saying:</p>
  
  <blockquote>
    <p>Invalid parameter number: number of bound variables does not match number of tokens</p>
  </blockquote>
  
  <p>code:</p>
  
  <pre><code>$first = (rand(1, 100));
  $second = (rand(1, 100));
  $last = $first + $second;
  $stmt = $connection-&gt;prepare("
  INSERT INTO equations (first_number, second_number, operation, result) 
  VALUES (:first_number, :second_number, :operation, :result)
  ");
  
  $stmt-&gt;bindParam(':first_number',$first, PDO::PARAM_INT);
  $stmt-&gt;bindParam(':second_number',$second, PDO::PARAM_INT);
  
  if ($last &lt;= 100) {
  
      $stmt-&gt;bindParam(':result', $last, PDO::PARAM_INT);
      $stmt-&gt;bindValue(':operation', "+", PDO::PARAM_STR);
  
  } else if ($first &gt; $second) {
  
      $second_result = $first - $second;
      $stmt-&gt;bindParam(':result', $second_result, PDO::PARAM_INT);
      $stmt-&gt;bindValue(':operation', "-", PDO::PARAM_STR);
  }
  $stmt-&gt;execute();
  </code></pre>