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

  • SEARCH
  • Home
  • 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 9193607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:12:26+00:00 2026-06-17T21:12:26+00:00

I have been coding for a few hours on this thing, so I think

  • 0

I have been coding for a few hours on this thing, so I think I am missing something very simple here, but I can’t seem to find it.

I am getting these 2 errors

Warning: PDOStatement::execute() [pdostatement.execute]: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens on line 77

Warning: PDOStatement::execute() [pdostatement.execute]: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens on line 79

public function resetPassword($password, $email){
    $rst    =   $this->db->prepare("insert into users (password) values (?) where email=? ");
    $rst->bindParam('?', $password);
    $rst->bindParam('?', $email);
    $rst->execute();
    
    if($rst->execute()){
        return "Password changed!"; 
    }
    else echo "Could not change password.";
}

Am I forgetting something?

  • 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-17T21:12:28+00:00Added an answer on June 17, 2026 at 9:12 pm

    When using questions marks as placeholders, you send an array to the execute method, like so: $rst->execute(array('placeholder1value', 'placeohlder2value'));

    However, if you want to use named placeholders, you would bindParam/bindValue them, like so:

    $stmt = $pdo->prepare('INSERT INTO table (key1, key2) VALUES (:key1, :key2)');
    $stmt->bindValue(':key1', 'somevalue', PDO::PARAM_STR);
    $stmt->bindValue(':key1', 3532, PDO::PARAM_INT);
    $stmt->execute();
    

    Please read about the difference between bindParam and bindValue

    And another note, your SQL query doesn’t make sense, do you mean to do an UPDATE?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im very new to all coding including jquery. I though this would have been
I have been coding in iphone platform for about a few months. One thing
I have been reading up most questions on this item, but somehow I can't
I have been coding for few days with swing, but im getting to a
This is a simple and very specific question: If you have been doing a
Ive never heard of this before, and I have been coding in PHP for
I've been coding a very sizable project and I have run into trouble with
I've been coding in Java for the past year, and i think I have
Have been working on this question for a couple hours and have come close
I have been struggling with these for a few hours now, and have come

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.