php - number of bound variables doesn't match number of tokens -


here sample of problem occurs. browser says error @ stmt->execute();

    function login($email, $password, $dbobj)      {        if ($stmt = $dbobj->prepare("select username, db_password, salt accounts email = :email limit 1"))         {           $stmt->bindparam(':username', $username);           $stmt->bindparam(':db_password', $db_password);           $stmt->bindparam(':salt', $salt);           $stmt->bindparam(':email', $email);           $stmt->execute();  // problem here           $stmt->fetch(pdo::fetch_obj);           $password = hash('sha512', $password . $salt);           if ($stmt->rowcount() == 1)            {               // ...           }        }     } 

well, bind 4 variables :username :db_password :salt , email there 1 token in statement - :email. not entirely sure trying either need amend sql or not use variables.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -