MySQL Column Problem
#1

Hello, i have this problem.

I manually added a table in PhpMyAdmin (not via SQL thing where you type in a code) via Structures > Add Column.

when i type /maketester in game, the command syntax is /maketester [playerid] [Level (1-2)].

i typed /maketester (My ID) 1. But when i checked MySQL via PhpMyAdmin, everyone's tester rank was set to 1, even if i specified ONLY my ID. And my code has no problem, as far as i know.

pawn Код:
CMD:maketester(playerid, params[])
{
    new iPlayer, iRank;
    if(sscanf(params, "ui", iPlayer, iRank)) return SendClientMessage(playerid, COLOR_GREY, "[Usage]: /maketester [PlayerID] [Level(1-2)]");
    if(!(0 <= iRank <= 2))
    {
        return SendClientMessage(playerid, COLOR_GREY, "Invalid level. Valid levels range from 0 to 2.");
    }
    if(PlayerInfo[playerid][pAdmin] >= 6)
    {
        if(!IsPlayerConnected(iPlayer))
        {
            return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected.");
        }
        if(!PlayerInfo[iPlayer][pLogged])
        {
            return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet.");
        }

        PlayerInfo[iPlayer][pTester] = iRank;
        SendClientMessageEx(iPlayer, COLOR_AQUA, "%s has set your Tester Level to {FF6347}%s{CFEFFC} (%i).", GetPlayerRPName(playerid), GetTesterRank(iPlayer), iRank);
        SendClientMessageEx(playerid, COLOR_AQUA, "you have set %s's Tester Level to {FF6347}%s{33CCFF} (%i).", GetPlayerRPName(iPlayer), GetTesterRank(iPlayer), iRank);
        mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET tester = %i", PlayerInfo[playerid][pTester]);
        mysql_tquery(connectionID, queryBuffer);
    }
    return 1;
}
help please?
Reply


Messages In This Thread
MySQL Column Problem - by SeanDenZYR - 08.04.2018, 11:27
Re: MySQL Column Problem - by 10MIN - 08.04.2018, 11:45
Re: MySQL Column Problem - by SeanDenZYR - 08.04.2018, 11:49

Forum Jump:


Users browsing this thread: 2 Guest(s)