CMySQLQuery::Execute[SendQuery()] - (error #1064)
#1

Hello,
I keep getting this error message in my mysql log:
Код HTML:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0, HasPackMoney = 0, SavedWantedLevel = 0, SavedJailTime = 0 WHERE `UserID` = 1' at line 1
But the issue is, I don't know how to fix it. I don't understand what the error is all about, and what's causing it.

I suppose my saveaccount code will be important.

pawn Код:
stock SaveAccount(playerid)
{
    new query[500];

    g_PlayerInfo[playerid][pMoney] = GetPlayerMoney(playerid);
    g_PlayerInfo[playerid][pScore] = GetPlayerScore(playerid);
    g_PlayerInfo[playerid][pSavedWantedLevel] = GetPlayerWantedLevel(playerid);

    format(query, sizeof(query), "UPDATE `Accounts` SET Bankcash = %d, Money = %d, Score = %d, Adminlevel = %d, Army = %d, Swat = %d, \
    RegularPlayer = %d, DrugHouseOwner = %d, OttoOwner = %d, TSkill = %d, RobSkill = %d, XP = %d, HasPackC4 = %d, HasPackRopes %d, \
    HasPackMoney = %d, SavedWantedLevel = %d, SavedJailTime WHERE `UserID` = %d"
, g_PlayerInfo[playerid][pBankcash], g_PlayerInfo[playerid][pMoney],
    g_PlayerInfo[playerid][pScore], g_PlayerInfo[playerid][pAdminlevel], g_PlayerInfo[playerid][pArmy], g_PlayerInfo[playerid][pSwat],
    g_PlayerInfo[playerid][pRegularPlayer], g_PlayerInfo[playerid][pDrugHouseOwner], g_PlayerInfo[playerid][pOttoOwner],
    g_PlayerInfo[playerid][pTSkill], g_PlayerInfo[playerid][pRobSkill], g_PlayerInfo[playerid][pXP], g_PlayerInfo[playerid][pHasPackC4], g_PlayerInfo[playerid][pHasPackRopes],
    g_PlayerInfo[playerid][pHasPackMoney], g_PlayerInfo[playerid][pSavedWantedLevel], g_PlayerInfo[playerid][pSavedJailTime], g_PlayerInfo[playerid][pUserID]);

    mysql_function_query(g_Handle, query, false, "SendQuery", "");

    return 1;
}
Reply
#2

Quote:
Код:
to use near '0, HasPackMoney
Код:
HasPackRopes %d, \
    HasPackMoney
Missed the "=" symbol.
Reply
#3

Oh wow, silly me. Anyway thanks for your help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)