new str[128]; format(str, sizeof(str), "UPDATE `playeraccounts` SET pSpawnPosX='%f', pSpawnPosY='%f', pSpawnPosZ='%f', pSpawnPosFacing='%f', pSpawnSaved='1', pMoney -='500' WHERE pID='%d'", pPickInfo[i][dXe], pPickInfo[i][dYe], pPickInfo[i][dZe], pPickInfo[i][dAe], PlayerInfo[playerid][pID]); mysql_query(Connection, str);
UPDATE `playeraccounts` SET pSpawnPosX='1111.111111', pSpawnPosY='1111.111111', pSpawnPosZ='1111.111111', pSpawnPosFacing='1111.111111', pSpawnSaved='1111.111111', pMoney -='500' WHERE pID='999' |
[10:43:44] [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 '-='500' WHERE pID='3'' at line 1
new str[128];
format(str, sizeof(str), "UPDATE `playeraccounts` SET pSpawnPosX='%f', pSpawnPosY='%f', pSpawnPosZ='%f', pSpawnPosFacing='%f', pSpawnSaved='1', pMoney ='500' WHERE pID='%d'", pPickInfo[i][dXe], pPickInfo[i][dYe], pPickInfo[i][dZe], pPickInfo[i][dAe], PlayerInfo[playerid][pID]);
mysql_query(Connection, str);
new str[200];
format(str, sizeof(str), "UPDATE `playeraccounts` SET pSpawnPosX=%f, pSpawnPosY=%f, pSpawnPosZ=%f, pSpawnPosFacing=%f, pSpawnSaved=1, pMoney = pMoney - 500 WHERE pID=%d", pPickInfo[i][dXe], pPickInfo[i][dYe], pPickInfo[i][dZe], pPickInfo[i][dAe], PlayerInfo[playerid][pID]);
mysql_query(Connection, str);
Compound operators would not work in SQL.Use pMoney = pMoney - 500
Make your string larger.(200 would be enough) Don't use quotes (' ') around field values that are not string that just provide extra overhead to parse data. PHP код:
|