SA-MP Forums Archive
MYSQL Sytnax error 1064 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MYSQL Sytnax error 1064 (/showthread.php?tid=535547)



MYSQL Sytnax error 1064 - Blademaster680 - 04.09.2014

I have this error on the saving, I am trying to save the skin of the player. Cant see why it is wrong.

Error:
[17:56:57] [ERROR] CMySQLQuery::Execute - (error #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 ''13' WHERE `Username` = 'Jason_Smith'' at line 1


Код:
mysql_format(dbHandle,Query, sizeof(Query), "UPDATE `PlayerData` SET `pSkin` = '%d', `pLevel` = '%d', `pFaction` = '%d', `pFacRank` '%d' WHERE `Username` = '%s'",
		pInfo[playerid][pSkin],
		pInfo[playerid][pLevel],
		pInfo[playerid][pFaction],
		pInfo[playerid][pFacRank],
		pName(playerid));
		mysql_query(dbHandle,Query,false);



Re: MYSQL Sytnax error 1064 - Stanford - 04.09.2014

Are you sure that the table's name is PlayerData? and are you sure of each collation-name??


Re: MYSQL Sytnax error 1064 - Blademaster680 - 04.09.2014

Yes everything else that needs to save is saving, like the rest of my stuff:
Working save:
Код:
mysql_format(dbHandle,Query, sizeof(Query), "UPDATE `PlayerData` SET `pCash` = '%d', `pBank` = '%d', `pAdminLevel` = '%d', `pModerator` = '%d', `pVipLevel` = '%d' WHERE `Username` = '%s'",
		pInfo[playerid][pCash],
		pInfo[playerid][pBank],
		pInfo[playerid][pAdminLevel],
		pInfo[playerid][pModerator],
		pInfo[playerid][pVipLevel],
		pName(playerid));
		mysql_query(dbHandle,Query,false);
It is just the line were the skins and stuff need to save... everything else saves fine, so I know the names etc are the same, just checked again to make sure

Ok I found the error. Clearly I was blind . There was no "=" by the pFacRank