Help with mysql
#4

always remember that if there is a string you need to use it like this

examples
pawn Код:
Language = '%s'
not like this

pawn Код:
Language = %s
here fix for update

pawn Код:
public OnPlayerSave(playerid) {
    new Query[500], string[500];
    format(string, sizeof(string), "UPDATE `players` SET `Language` = '%s', `Money` = %d, `XP` = %d, `Total XP` = %d, `Level` = %d, `VIP Level` = %d, `Admin Level` = %d, `Kills` = %d, `Deaths` = %d");
    strcat(string, "`Muted` = '%s', `Mute TimeStamp` = '%s', `Mute Reason` = '%s', `Freezed` = '%s', `Freeze TimeStamp` = '%s', `Freeze Reason` = '%s', `Jailed` = '%s', `Jail TimeStamp` = '%s', `Jail Reason` = '%s'");
    strcat(string, "`Banned` = '%s', `Ban TimeStamp` = '%s', `Ban Reason` = '%s', `Warns` = %d, `Warn Reason 1` = '%s', `Warn Reason 2` = '%s', `Warn Reason 3` = '%s', `Warn Reason 4` = '%s', `Warn Reason 5` = '%s'");
    mysql_format(mysql_handle, Query, sizeof(Query), string,
    PlayerInfo[playerid][pLanguage], PlayerInfo[playerid][pMoney], PlayerInfo[playerid][pXP], PlayerInfo[playerid][pTotalXP], PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pVIPLevel], PlayerInfo[playerid][pAdminLevel], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths],
    PlayerInfo[playerid][pMuted], PlayerInfo[playerid][pMuteTime], PlayerInfo[playerid][pMuteReason], PlayerInfo[playerid][pFreezed], PlayerInfo[playerid][pFreezeTime], PlayerInfo[playerid][pFreezeReason], PlayerInfo[playerid][pJailed], PlayerInfo[playerid][pJailTime], PlayerInfo[playerid][pJailReason],
    PlayerInfo[playerid][pBanned], PlayerInfo[playerid][pBanTime], PlayerInfo[playerid][pBanReason], PlayerInfo[playerid][pWarns], PlayerInfo[playerid][pWarnReason1], PlayerInfo[playerid][pWarnReason2], PlayerInfo[playerid][pWarnReason3], PlayerInfo[playerid][pWarnReason4], PlayerInfo[playerid][pWarnReason5]);
    mysql_tquery(mysql_handle, Query, "", "");
    return 1;
}
tell me if there again error ouccors
Reply


Messages In This Thread
Help with mysql - by bgedition - 08.01.2015, 11:38
Re: Help with mysql - by JeaSon - 08.01.2015, 12:15
Re: Help with mysql - by bgedition - 08.01.2015, 15:36
Re: Help with mysql - by JeaSon - 08.01.2015, 16:20
Re: Help with mysql - by bgedition - 09.01.2015, 14:13
Re: Help with mysql - by JeaSon - 09.01.2015, 19:11
Re: Help with mysql - by bgedition - 09.01.2015, 19:22
Re: Help with mysql - by JeaSon - 09.01.2015, 19:25
Re: Help with mysql - by bgedition - 09.01.2015, 19:33
Re: Help with mysql - by bgedition - 09.01.2015, 19:55

Forum Jump:


Users browsing this thread: 1 Guest(s)