public static function setPassword($username, $password, $connection) { if (usertools::passwordRequirements($password, $GLOBALS["min_password_length"], $GLOBALS["password_need_specialchars"])) { $password = hash($GLOBALS["password_hash"], $password); $connection->exec('UPDATE users SET password="******" WHERE username="******";'); } }