mysql help
#1

I have this code to login, but even if he gets the password wrong it says "You successfully logged in"
I can't get it why?
pawn Код:
if(dialogid == Logindialog)
    {
        if(!response) return Kick(playerid) && SendClientMessage(playerid,red,"Have it you're way");
        new string[200];
        format(Query, sizeof(Query), "SELECT * FROM `Accounts` WHERE `Username` = '%s' AND `Password` = '%s'",
        GetPName(playerid),
        inputtext);
        mysql_query(Query);
        if(!mysql_num_rows())
        {
            PInfo[playerid][Failedlogins] ++;
            format(string,sizeof(string),""lred"You have failed %i/3 times you're login \n"lwhite"Hey "lgreen"%s"lwhite", you're account is registered \n"lwhite"Please enter a password to continue\n"lwhite"Or press cancel to "lred"leave",PInfo[playerid][Failedlogins],GetPName(playerid));
            ShowPlayerDialog(playerid,Logindialog,1,"Login",string,"Ok","Cancel");
            if(PInfo[playerid][Failedlogins] == 3)
            {
                format(string,sizeof(string),"||- Announcement: %s has failed 3 times login and has been kicked -||",GetPName(playerid));
                Kick(playerid);
                SendAdminMessage(white,string);
            }
            return 1;
        }
        SendClientMessage(playerid,yellow,"You have successfully logged in!");
    }
Reply
#2

You need to use mysql_store_result(); after your query.
Reply
#3

Quote:
Originally Posted by JamesC
Посмотреть сообщение
You need to use mysql_store_result(); after your query.
nvm i fixed it mah self.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)