mysql login bug :/
#1

I get login in if its correct password but I get logged in too when i typed incorrect password.
Here is the code.

pawn Код:
case d_login:
        {
            if(!response) return Kick(playerid);

            new hpass[129];
            new Query[100];
            WP_Hash(hpass, 129, inputtext);
            if(!strcmp(hpass, PlayerInfo[playerid][Password]))
            {
                mysql_format(mysql, Query, sizeof(Query),"SELECT * FROM `players` WHERE `Username` = '%e' LIMIT 1", Name[playerid]);
                mysql_tquery(mysql, Query, "OnAccountLoad", "i", playerid);
            }
            else
            {
                ShowPlayerDialog(playerid, d_login, DIALOG_STYLE_INPUT, "Login", "{FF0000}Error Login: Password Incorrect", "Login", "Quit");
            }
        }
thnk you.
Reply
#2

Try
pawn Код:
mysql_format(mysql, Query, sizeof(Query),"SELECT * FROM `players` WHERE `Username` = '%e' AND `Password` = '%e' LIMIT 1", Name[playerid], hpass);
I'm just guessing your password field is called Password.
Reply
#3

fixed my self. thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)