MYSQL Sytnax error 1064
#1

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);
Reply
#2

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)