From fa7acdf3e83c4ee5d7fa785df01ba73d86dbc129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez?= <45081533+FerMdez@users.noreply.github.com> Date: Wed, 7 Apr 2021 14:59:26 +0200 Subject: [PATCH] Update user_dao.php --- assets/php/user_dao.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/php/user_dao.php b/assets/php/user_dao.php index 04726b3..04b64d7 100644 --- a/assets/php/user_dao.php +++ b/assets/php/user_dao.php @@ -46,7 +46,8 @@ //Returns a query to check if the user pass matches: public function selectPass($password){ - $sql = sprintf( "SELECT * FROM users WHERE passwd = '%s'", $password ); + //$sql = sprintf( "SELECT * FROM users WHERE passwd = '%s'", $password ); + $sql = sprintf( "SELECT * FROM users WHERE user = '%s' AND pass = '%s'", $username, $password); //return $sql; return $result = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); @@ -67,4 +68,4 @@ } -?> \ No newline at end of file +?>