08.08.2013, 19:32
Yeah, I get this error in the server.exe whenever a player disconnects my server and the data does not save.
The code:
EDIT: Nevermind, I've fixed it already.
pawn Код:
Error (0): Failed to exeute query. 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 'id` = '1' LIMIT 1' at line 1.
pawn Код:
SavePlayer(playerid)
{
if(pInfo[playerid][Logged] == 1)
// checks if the player is logged
{
new Query[500];
format(Query, 500, "UPDATE `playerdata` SET `admin` = '%d', `score` = '%d', `money` = '%d', `kills` = '%d', `deaths` = '%d', `sec` = '%d', `min` = '%d', `hour = '%d' WHERE `id` = '%d'",
pInfo[playerid][pAdmin],
pInfo[playerid][pKills],
GetPlayerMoney(playerid),
pInfo[playerid][pKills],
pInfo[playerid][pDeaths],
pInfo[playerid][pSec],
pInfo[playerid][pMin],
pInfo[playerid][pHour],
pInfo[playerid][ID]);
mysql_query(Query);
//this basically gets the variables and stores it to the players special identifier called "ID".
}
}
EDIT: Nevermind, I've fixed it already.