Query Error | Can't find the error..
#1

I've talked to Emmet_ on skype about it and he's helped me sort a few of the errors out. But there seems to be some remaining that i cannot find for some reason (maybe because my eyesight is shit..)

Error Log( Erreur de syntaxe prиs de = Syntax Error Near ):
Код:
EID: 1064 | Error: Erreur de syntaxe prиs de '0', `FactionID` = '-1', `FactionHasLeadership` = '-1', `FactionRank` = '-1', `Fa' а la ligne 1 | Query: UPDATE `character_data` SET `Character_X` = '99.941238', `Character_Y` = '175.007415', `Character_Z` = '-6.265733', `Character_F` = '0.000000', `CharacterAge` = '37', `CharacterSkin` = '120', `CharacterAccent` = '1010', `CharacterMoneyOnHand` = '0', `CharacterPaydayAmount` = '0', `CharacterHasBankAccount` = '1', `CharacterBankBalance` = '50000', `CharacterBankLoaned` = '0', `CharacterHasCard` = '0', `CharacterCardPin` = '0', `CharacterIntrestBalance` = '0', `CharacterJobID` = '0', `CharacterCompanyID` = '0, `CharacterCompanyRank` = '', `CharacterCompanyPermissions` = '0', `FactionID` = '-1', `FactionHasLeadership` = '-1', `FactionRank` = '-1', `FactionRank` = 45, `CharacterHealth` = '0.000000', `CharacterArmour` = '0.000000', `CharacterWeapon1` = '0', `CharacterWeapon2` = '0', `CharacterWeapon3` = '0', `CharacterWeapon4` = '0', `CharacterWeapon5` = '0', `CharacterWeapon6` = '0', `CharacterWeapon7` = '0', `CharacterWeapon8` = '0', `CharacterWeapon9` = '0', `CharacterWeapon10` = '0', `CharacterWeapon11` = '0', `CharacterWeapon12` = '0', `CharacterWeapon13` = '0', `CharacterWeaponAmmo1` = '0', `CharacterWeaponAmmo2` = '0', `CharacterWeaponAmmo3` = '0', `CharacterWeaponAmmo4` = '0', `CharacterWeaponAmmo5` = '0', `CharacterWeaponAmmo6` = '0', `CharacterWeaponAmmo7` = '0', `CharacterWeaponAmmo8` = '0', `CharacterWeaponAmmo9` = '0', `CharacterWeaponAmmo10` = '0', `CharacterWeaponAmmo11` = '0', `CharacterWeaponAmmo12` = '0', `CharacterWeaponAmmo13` = '0' WHERE `CharID` = '1'
pawn Код:
stock SaveCharacterStats(playerid)
{
    static q[4000], Float: f[4];
    new scid = CurrentCharacterID[playerid];
    SaveWeapons(playerid);

    GetPlayerPos(playerid, f[0], f[1], f[2]);
    GetPlayerFacingAngle(playerid, f[3]);
    format(q, sizeof(q), "UPDATE `character_data` SET `Character_X` = '%f', `Character_Y` = '%f', `Character_Z` = '%f', `Character_F` = '%f', `CharacterAge` = '%d', `CharacterSkin` = '%d'",
        f[0],
        f[1],
        f[2],
        f[3],
        CharacterInfo[playerid][scid][CharacterAge],
        CharacterInfo[playerid][scid][CharacterSkin]);
    format(q, sizeof(q),"%s, `CharacterAccent` = '%s', `CharacterMoneyOnHand` = '%d', `CharacterPaydayAmount` = '%d', `CharacterHasBankAccount` = '%d', `CharacterBankBalance` = '%d', `CharacterBankLoaned` = '%d'",
        q,
        CharacterInfo[playerid][scid][CharacterAccent],
        CharacterInfo[playerid][scid][CharacterMoneyOnHand],
        CharacterInfo[playerid][scid][CharacterPaydayAmount],
        CharacterInfo[playerid][scid][CharacterHasBankAccount],
        CharacterInfo[playerid][scid][CharacterBankBalance],
        CharacterInfo[playerid][scid][CharacterBankLoaned]);
    format(q,sizeof(q), "%s, `CharacterHasCard` = '%d', `CharacterCardPin` = '%d', `CharacterIntrestBalance` = '%d', `CharacterJobID` = '%d', `CharacterCompanyID` = '%d', `CharacterCompanyRank` = '%s', `CharacterCompanyPermissions` = '%d'",
        q,
        CharacterInfo[playerid][scid][CharacterHasCard],
        CharacterInfo[playerid][scid][CharacterCardPin],
        CharacterInfo[playerid][scid][CharacterIntrestBalance],
        CharacterInfo[playerid][scid][CharacterJobID],
        CharacterInfo[playerid][scid][CharacterCompanyID],
        CharacterInfo[playerid][scid][CharacterCompanyRank],
        CharacterInfo[playerid][scid][CharacterCompanyPermissions]);
    format(q,sizeof(q), "%s, `FactionID` = '%d', `FactionHasLeadership` = '%d', `FactionRank` = '%d', `CharacterHealth` = '%f', `CharacterArmour` = '%f'",
        q,
        CharacterInfo[playerid][scid][FactionID],
        CharacterInfo[playerid][scid][FactionHasLeadership],
        CharacterInfo[playerid][scid][FactionRank],
        CharacterInfo[playerid][scid][FactionBadge],
        GetPlayerHealthEx(playerid),
        GetPlayerArmourEx(playerid));

    for(new wi = 0; wi < 13; wi ++)
    {
        format(q,sizeof(q), "%s, `CharacterWeapon%d` = '%d'", q, wi+1, CharacterInfo[playerid][scid][CharacterWeapon][wi]);
    }

    for(new wia = 0; wia < 13; wia ++)
    {
        format(q,sizeof(q), "%s, `CharacterWeaponAmmo%d` = '%d'", q, wia+1, CharacterInfo[playerid][scid][CharacterWeapon][wia]);
    }

    format(q, sizeof(q), "%s WHERE `CharID` = '%d'", q, CharacterInfo[playerid][scid][CharacterID]);

    mysql_function_query(MySQL_Connection, q, false, "GrabMySQLData","iii", "", playerid, -1, -1);  
}
Reply
#2

maybe you missed a string to escape ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)