-1

I have a problem but i don't know where is a mistake?

private function getUsersPasswordByEmail($email){

        $stmt = $this->con->prepare("SELECT 'password' FROM 'user' WHERE 'email' = ?");
        $stmt->bind_param("s", $email);
        $stmt->execute();
        $stmt->bind_result($password);
        $stmt->fetch();
        return $password;}

error is in this line -

$stmt->bind_param("s", $email);

Details Type: Error Message: Call to a member function bind_param() on bool File: C:\xampp\htdocs\MyApi\includes\DbOperations.php Line: 63

1 Answers1

0

Try using ` backtick instead of ' single quote

$stmt = $this->con->prepare("SELECT `password` FROM `user` WHERE `email` = ?");
$stmt->bind_param("s", $email);
LIGHT
  • 5,604
  • 10
  • 35
  • 78