Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8224773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:11:10+00:00 2026-06-07T15:11:10+00:00

My code produces the error: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does

  • 0

My code produces the error:

SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens

But I counted, there are no missing colons and all the binding parameters are there… What is causing this error?

Reference the Code Below:

try{
    $pdo->beginTransaction();

    $insert1 = $pdo->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->prepare("SELECT vendorname FROM vendorDefinition WHERE id=:svid LIMIT 1");
    $resultC = $pdo->prepare("SELECT destinationName FROM shipDestination WHERE id=:locationselect LIMIT 1");

    $insert1->execute(array(":spoprefix"=>$_POST['SPOprefix'],
                            ":nowdate"=>$nowdate,
                            ":location"=>$_POST['locationselect'],
                            ":selvid"=>$_POST['selectedVID'],
                            ":cgrade"=>$_POST['const_grade'],
                            ":cflute"=>$_POST['const_flute'],
                            ":vendorqty"=>$_POST['vendorqty'],
                            ":wdat"=>$wdat,
                            ":ldat"=>$ldat,
                            ":scoreline"=>$scoreline,
                            ":duedate"=>$duedate,
                            ":vendorremark"=>$_POST['vendorremark'],
                            ":iso"=>"",
                            ":squarem"=>$_POST['squaremeter'],
                            ":squareft"=>$_POST['squarefeet'],
                            ":siid",$_POST['const_siid'],
                            ":wasteqty"=>$_POST['wasteqty'],
                            ":thisprice"=>$_POST['thisprice']));

    $resultB->execute(array(":svid"=>$_POST['selectedVID']));
    $resultC->execute(array(":locationselect"=>$_POST['locationselect']));

    $pdo->commit();

 }catch(PDOException $e){
    $pdo->rollBack();
    die("<h1>ERROR" . $e);
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:11:11+00:00Added an answer on June 7, 2026 at 3:11 pm

    Problem is here:

    ":siid",$_POST['const_siid'],
           ^--- should be "=>", not ","
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The code below produces an error saying that my input string was not in
Why the following code produces the error? The query operator 'ElementAtOrDefault' is not supported
this code produces 17 error C2995: function template has already been defined; there was
The following code produces no suitable constructor found error. I am unable to figure
The following code produces wrong and inconsistent output with gcc (4.1.2 20080704) but correct
Using PyQt4 4.8.6 the code below produces the error QObject::startTimer: QTimer can only be
My javascript code that produces a syntax error: var x = { a: 123
What's wrong with this line of code? bar foo(vector ftw); It produces error C2061:
The following code produces an error, any ideas why? string dateFormatString = dd.MM.yyyy HH:mm:ss;
The following code produces an error. dbo.getit works fine when I call it directly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.