26.09.2015, 08:25
I'm having this syntax error:
In this code:
What's wrong?
Quote:
[04:24:25] [DEBUG] mysql_tquery - scheduling query "UPDATE `players` SET `VipTime`=0, `Warns`=3, `Cookies`=89, `Jailed`=0, `Muted`=0, `RegisterDate`=0, `Duty`=0, `Nopm`=0 WHERE `ID`=0".. [04:24:25] [DEBUG] CMySQLQuery::Execute[()] - starting query execution [04:24:25] [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 'WHERE `ID`=' |
Код:
stock SaveStatsForPlayer(playerid) { new query[700], query2[500]; mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `IP`='%s', `Admin`=%d, `VIP`=%d, `Deaths`=%d, `Score`=%d, `Money`=%d, `MissionsPlayed`=%d, WHERE `ID`=%d", IP[playerid], pData[playerid][Admin], pData[playerid][VIP], pData[playerid][Deaths], GetPlayerScore(playerid), pData[playerid][Money], pData[playerid][MissionsPlayed]); mysql_format(mysql, query2, sizeof(query2), "UPDATE `players` SET `VipTime`=%d, `Warns`=%d, `Cookies`=%d, `Jailed`=%d, `Muted`=%d, `RegisterDate`=%d, `Duty`=%d, `Nopm`=%d WHERE `ID`=%d", pData[playerid][VipTime], pData[playerid][Warns], pData[playerid][Cookies], pData[playerid][Jailed], pData[playerid][Muted], pData[playerid][RegisterDate],pData[playerid][Duty], pData[playerid][Nopm], pData[playerid][ID]); mysql_tquery(mysql, query, "", ""); mysql_tquery(mysql, query2, "", ""); }