login error
#1

pawn Код:
if(dialogid == 40)
    {
        if(!response)
        {
            Kick(playerid);
        }
        if(response)
        {
            new query[500];
            new escpname[24];
            mysql_real_escape_string(gPlayerInfo[playerid][pName],escpname);
            format(query, sizeof(query),"SELECT * FROM `playerinfo` WHERE `user`='%s' AND `password`='%d'",
            escpname,udb_hash(inputtext));
            mysql_query(query);
            mysql_store_result();
            if(!mysql_num_rows())
            {
                SendClientMessage(playerid, YELLOW, "Invalid password!");
                SetPVarInt(playerid, "WrongPass", GetPVarInt(playerid, "WrongPass") + 1);
                ShowPlayerDialog(playerid, 15000, DIALOG_STYLE_PASSWORD , "Login", "welcome, if you-re registred login or /register", "OK", "Leave");
                mysql_store_result();
                if(GetPVarInt(playerid, "WrongPass") == 3)
                {
                   Messagekick(playerid, "Max password tries exceeded!");
                   /*SendClientMessage(playerid, YELLOW, "Max password tries exceeded!!");
                   Kick(playerid);*/

                }
               
            }
            else
            {
                new field[160];
                gPlayerInfo[playerid][pLogged]=1;
                gPlayerInfo[ playerid ][ pPassword ] = udb_hash(inputtext);
                SendClientMessage(playerid,0x009600AA,"Logged in!");
                isplayerloggedin[playerid] = 1;
                firstconnected[playerid] = 1;
                format(query, sizeof(query),"UPDATE `playerinfo` SET `online` = '1' WHERE `user` = '%s'", gPlayerInfo[playerid][pName]);
                mysql_query(query);
                mysql_fetch_int("id",gPlayerInfo[playerid][pDBID]);
                mysql_fetch_int("kills",gPlayerInfo[playerid][pKills]);
                mysql_fetch_int("deaths",gPlayerInfo[playerid][pDeaths]);
                mysql_fetch_int("level",gPlayerInfo[playerid][pAlevel]);
                mysql_fetch_int("score",gPlayerInfo[playerid][pScore]);
                Scoresync(playerid,gPlayerInfo[playerid][pScore]);
                mysql_fetch_int("money",gPlayerInfo[playerid][pMoney]);
                mysql_store_result();
            }
            mysql_free_result();

       }
    }
    return 1;
}
i tried everything, this is kinda freaking me out x_X
could anyone help meї?
it show this
pawn Код:
[MySQL] Error (0): Function: mysql_store_result called when result already stored. Use mysql_free_result first.
Reply
#2

Код:
mysql_store_result();
on line 21 seems redundant
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)