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 8782711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:38:20+00:00 2026-06-13T20:38:20+00:00

I am having trouble getting this to work I think my error is in

  • 0

I am having trouble getting this to work I think my error is in the syntax of the prepared statement but I have tried several different methods with no luck. The reason I suspect that the error is in the prepared statement is because it will echo Not a Match on the page if the variables dont match but when they do match it will just give me a blank page with no errors. Here is my code maybe someone can spot the error in the mean time I will keep trying different methods.

    function setPass($conn, $userCurrent, $oldPass, $newPass, $verPass)

{        
    $stmt= $conn->prepare('SELECT `password` FROM `CLL_users` WHERE `user_name`=:userCurrent');
    $stmt->execute(array(':userCurrent' => $userCurrent));
    while ($pass = $stmt->fetch()){
    $oldDbPass = $pass['password'];
    }

$new_pass = md5($newPass);

    if (md5($oldPass) == ($oldDbPass) && ($newPass) == ($verPass)) {
try{
        $stmt= $conn->prepare('UPDATE `CLL_users` SET `password`=:newPass WHERE `user_name`=:userCurrent');
        $stmt->execute(array(':newpass' => $new_pass, ':userCurrent' => $userCurrent));
} catch (PDOException $e){
    echo 'Connection failed: ' . $e->getMessage();
}

        echo "Match";
    } else {
        echo "Not a Match";

    }

}
  • 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-13T20:38:22+00:00Added an answer on June 13, 2026 at 8:38 pm

    You’re mistaking parenthesis for backticks. Use backticks “`” to escape table and column names in SQL.

    SELECT `password` FROM `CLL_users` WHERE `user_name`=:userCurrent
    
    UPDATE `CLL_users` SET `password`=:newPass WHERE `user_name`=:userCurrent
    

    You also have several typos:

    • $newPass is declared as camelCase, but used as $new_pass in your second execute statement.
    • I’m not sure if PDO statements are case sensitive, but you’re declaring the PDO variable as :newPass and using it as :newpass in the execute

    For the future, read about error checking/handling in PDO:

    • http://php.net/manual/en/pdo.error-handling.php
    • http://php.net/manual/en/pdo.errorcode.php
    • http://php.net/manual/en/pdo.errorinfo.php
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok this seems so silly but I'm having some trouble getting this to work.
I'm having trouble getting django-admin.py to work... it's in this first location: /Users/mycomp/bin/ but
I'm sure this is fairly straightforward but i'm having trouble getting it to work.
I am having trouble getting this invisibilityOfElementLocated() method to work. Here is the code
I am having trouble storing a numpy csr_matrix with PyTables. I'm getting this error:
I'm having trouble using variables in my SQL WHERE clause. I'm getting this error:
I'm hoping there's a simple resolution for this, but I'm having trouble getting the
Im having trouble getting this to work, here´s a quick overview of the idea.
I'm having trouble getting jQuery's $(this) function to work as expected... or rather, to
I am having trouble getting web services to work in ColdFusion. This works just

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.