Working function and query queryLogin.php