title: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
body: <p>My code produces the error:</p>
  
  <pre><code>SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
  </code></pre>
  
  <p>But I counted, there are no missing colons and all the binding parameters are there... What is causing this error?</p>
  
  <p>Reference the Code Below:</p>
  
  <pre><code>try{
      $pdo-&gt;beginTransaction();
  
      $insert1 = $pdo-&gt;prepare("INSERT INTO spo (spo_prefix,datecreated,destinationID,vendorID,grade,flute,qty,wdat,ldat,scoreline,due,remark,isowarrant,area_m,area_ft,supplyIDs,qty_waste,expectedPrice) VALUES (:spoprefix,:nowdate,:location,:selvid,:cgrade,:cflute,:vendorqty,:wdat,:ldat,:scoreline,:duedate,:vendorremark,:iso,:squarem,:squareft,:siid,:wasteqty,:thisprice)");
  
      $resultB = $pdo-&gt;prepare("SELECT vendorname FROM vendorDefinition WHERE id=:svid LIMIT 1");
      $resultC = $pdo-&gt;prepare("SELECT destinationName FROM shipDestination WHERE id=:locationselect LIMIT 1");
  
      $insert1-&gt;execute(array(":spoprefix"=&gt;$_POST['SPOprefix'],
                              ":nowdate"=&gt;$nowdate,
                              ":location"=&gt;$_POST['locationselect'],
                              ":selvid"=&gt;$_POST['selectedVID'],
                              ":cgrade"=&gt;$_POST['const_grade'],
                              ":cflute"=&gt;$_POST['const_flute'],
                              ":vendorqty"=&gt;$_POST['vendorqty'],
                              ":wdat"=&gt;$wdat,
                              ":ldat"=&gt;$ldat,
                              ":scoreline"=&gt;$scoreline,
                              ":duedate"=&gt;$duedate,
                              ":vendorremark"=&gt;$_POST['vendorremark'],
                              ":iso"=&gt;"",
                              ":squarem"=&gt;$_POST['squaremeter'],
                              ":squareft"=&gt;$_POST['squarefeet'],
                              ":siid",$_POST['const_siid'],
                              ":wasteqty"=&gt;$_POST['wasteqty'],
                              ":thisprice"=&gt;$_POST['thisprice']));
  
      $resultB-&gt;execute(array(":svid"=&gt;$_POST['selectedVID']));
      $resultC-&gt;execute(array(":locationselect"=&gt;$_POST['locationselect']));
  
      $pdo-&gt;commit();
  
   }catch(PDOException $e){
      $pdo-&gt;rollBack();
      die("&lt;h1&gt;ERROR" . $e);
   }
  </code></pre>