SQL Query doesn't grab the right info.
#1

As the topic says... This code tells the player it's wrong password. Wether it's wrong or right. And kicks them. Why?

pawn Код:
stock PlayerLogin(playerid, password)
{
    new str[128];
    format(str, sizeof(str),"SELECT * FROM users WHERE username = '%s' AND password = md5('%s')",pName(playerid),password);
    mysql_query(str);
    mysql_store_result();
    if(!mysql_num_rows())
    {
        SendInfoMessage(playerid,"Wrong {a9c4e4}password{ffffff}! Kicked due to security reasons!");
        Kick(playerid);
        mysql_free_result();
        return 1;
    }
    else
    {
        SendInfoMessage(playerid,"Successfully logged in. Welcome back!");
        mysql_free_result();
        return 1;
    }
}
Reply


Messages In This Thread
SQL Query doesn't grab the right info. - by introzen - 26.06.2013, 15:16
Re: SQL Query doesn't grab the right info. - by Sinner - 26.06.2013, 16:57
Re: SQL Query doesn't grab the right info. - by Jefff - 26.06.2013, 17:11
Re: SQL Query doesn't grab the right info. - by introzen - 26.06.2013, 18:59
Re: SQL Query doesn't grab the right info. - by introzen - 27.06.2013, 14:03
Re: SQL Query doesn't grab the right info. - by Haydz - 27.06.2013, 14:05
Re: SQL Query doesn't grab the right info. - by introzen - 28.06.2013, 15:23
Re: SQL Query doesn't grab the right info. - by introzen - 28.06.2013, 15:44
Re: SQL Query doesn't grab the right info. - by introzen - 28.06.2013, 16:22

Forum Jump:


Users browsing this thread: 1 Guest(s)