String size..
#1

Ok, so i started MySQL, i kinda get it by now. But i got this question.

When using the 'UPDATE' thingy ( lol ), i would love to get some help on the size of a string it needs for a simple command. let me explain

pawn Код:
CMD:setlevel(playerid, params[])
{
    new ID, Level, query[300];
    if(sscanf(params, "ui", ID, Level)) return SendClientMessage(playerid, COLOR_RED, "* Usage: /SetLevel < PlayerID > < Level >");
    if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "* That user is offline!");
    format(query, sizeof(query), "UPDATE `playerinfo` SET `Level` = %d WHERE `user` = '%s'", Level, pName(ID));
    mysql_query(query);
    format(Msg, sizeof(Msg), "* Admin %s has made %s (%d) admin level %d", pName(playerid), pName(ID), ID, Level);
    SendClientMessageToAll(COLOR_ORANGE, Msg);
    SetPVarInt(playerid, "Level", Level);
    return 1;
}
As you see, i use 'query[300]' just to update the player's level, is that how big the string size supposed to be? or am i using too much for just a command?
Reply
#2

256 is max string i think.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)