Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2007
    Posts
    80
    Thanks
    1
    Thanked 0 Times in 0 Posts

    PDOStatement Issue

    What's this error about? Line 27 is the $sql line.
    [16-Apr-2019 03:21:49 UTC] PHP Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in C:\wamp64\www\a2019\database.php on line 27

    PHP Code:
    $sql "SELECT * FROM fleetproposal WHERE SimInstanceID = :SimInstanceID AND MonthID >= :OfferID AND ProposalStatus = 1";
    $stmt $db->doQuery($sql, array(':SimInstanceID' => $SimInstanceID':OfferID' => $OfferID)); 

  2. #2
    Senior Coder benanamen's Avatar
    Join Date
    Oct 2015
    Posts
    1,591
    Thanks
    10
    Thanked 161 Times in 156 Posts
    You have 3 parameters in the query and only two in the array.
    To save time, lets just assume I am almost never wrong.

    The XY Problem
    The XY problem is asking about your attempted solution (X) rather than your actual problem (Y). This leads to enormous amounts of wasted time and energy, both on the part of people asking for help, and on the part of those providing help.

    Make A Donation https://www.paypal.me/KevinRubio

  3. #3
    New Coder
    Join Date
    Mar 2007
    Posts
    80
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by benanamen View Post
    You have 3 parameters in the query and only two in the array.

    Do I have to pass in ProposalStatus as a parameter even if it's not a variable for this particular script?


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •