format(string, sizeof(string), "UPDATE players SET Note1=%s WHERE id=%d", PlayerInfo[playerid][pNote1], PlayerInfo[pSQLID]);
CMySQLHandler::Query(UPDATE players SET Note1= WHERE id=) - An error has occured. (Error ID: 1064, 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 'Note2' at line 1)
UPDATE players SET Note1= '%s' WHERE id = '%d'
format(string, sizeof(string), "UPDATE players SET Note1=%s WHERE id=%d",
PlayerInfo[playerid][pNote1],
PlayerInfo[pSQLID]);
printf("%s", string);
string: UPDATE players SET Mission=0,Warnings=0,VirWorld=0,Fuel=0,Married=78,MarriedTo=0,FishTool=78,Note1='',Note1s=78,Note2='',Note2s=78,Note3='',Note3s=78,Note4='',Note4s=78,Note5='',Note5s=0,Locked=0 WHERE id=
format(string, sizeof(string), "UPDATE players SET InvWeapon=%d,InvAmmo=%d,Lighter=%d,Cigarettes=%d,RequestingBackup=%d,Roadblock=%d,Mask=%d,Maskuse=%d,HideNumber=%d,Speaker=%d WHERE id=%d", PlayerInfo[playerid][pInvWeapon], PlayerInfo[playerid][pInvAmmo], PlayerInfo[playerid][pLighter], PlayerInfo[playerid][pCigarettes], PlayerInfo[playerid][pRequestingBackup], PlayerInfo[playerid][pRoadblock], PlayerInfo[playerid][pMask], PlayerInfo[playerid][pMaskuse], PlayerInfo[playerid][pHideNumber], PlayerInfo[playerid][pSpeaker], PlayerInfo[playerid][pSQLID]); MySQLCheckConnection(); mysql_query(string);
Код:
format(string, sizeof(string), "UPDATE players SET InvWeapon=%d,InvAmmo=%d,Lighter=%d,Cigarettes=%d,RequestingBackup=%d,Roadblock=%d,Mask=%d,Maskuse=%d,HideNumber=%d,Speaker=%d WHERE id=%d", PlayerInfo[playerid][pInvWeapon], PlayerInfo[playerid][pInvAmmo], PlayerInfo[playerid][pLighter], PlayerInfo[playerid][pCigarettes], PlayerInfo[playerid][pRequestingBackup], PlayerInfo[playerid][pRoadblock], PlayerInfo[playerid][pMask], PlayerInfo[playerid][pMaskuse], PlayerInfo[playerid][pHideNumber], PlayerInfo[playerid][pSpeaker], PlayerInfo[playerid][pSQLID]); MySQLCheckConnection(); mysql_query(string); |
format(string, sizeof(string), "UPDATE players SET Mission=%d,Warnings=%d,VirWorld=%d,Fuel=%d,Married=%d,MarriedTo=%d,FishTool=%d,Note1='%s',Note1s=%d,Note2='%s',Note2s=%d,Note3='%s',Note3s=%d,Note4='%s',Note4s=%d,Note5='%s',Note5s=%d,Locked=%d WHERE id=%d", PlayerInfo[playerid][pMissionNr], PlayerInfo[playerid][pWarns], PlayerInfo[playerid][pVirWorld], PlayerInfo[playerid][pMarried], PlayerInfo[playerid][pMarriedTo], PlayerInfo[playerid][pFishTool], PlayerInfo[playerid][pNote1], PlayerInfo[playerid][pNote1s], PlayerInfo[playerid][pNote2], PlayerInfo[playerid][pNote2s], PlayerInfo[playerid][pNote3], PlayerInfo[playerid][pNote3s], PlayerInfo[playerid][pNote4], PlayerInfo[playerid][pNote4s], PlayerInfo[playerid][pNote5], PlayerInfo[playerid][pNote5s], PlayerInfo[playerid][pLocked], PlayerInfo[playerid][pSQLID]); MySQLCheckConnection(); mysql_query(string);