17.04.2013, 05:41
WHERE ID = %d" you have no reference to your id, I'm not sure how your system indexes users but I'm thinking it should look something like this
That is to the best of my knowledge I've only used SQLITE but it should be something like that I gather.
pawn Код:
stock savePlayer(playerid) {
new
szQuery[512]; // This is the only 512 strign exception, for our queries if we lower it... Then that won't be good...
format(szQuery, sizeof(szQuery), "UPDATE `players` SET `Money` = '%d', `Score` = '%d', `Admin` = '%d', `Kills` = '%d', `Deaths` = '%d', `Weather` = '%d'", GetPlayerMoney(playerid), GetPlayerScore(playerid), PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pWeather]);
format(szQuery, sizeof(szQuery), "%s, `Skin` = '%d', `Time` = '%d', `Color` = '%d', `Tele` = '%d', `Message` = '%d' WHERE `PlayerName` = '%s'", szQuery, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pTime], PlayerInfo[playerid][pColor], PlayerInfo[playerid][pColor], PlayerInfo[playerid][pTele], PlayerInfo[playerid][pMessage], ReturnName(playerid));
mysql_query(szQuery, THREAD_NO_RESULT, playerid, iConnectionHandle);
return 1;
}