Problem MySQL Save Player
#1

I have a problem. This is my script:

pawn Код:
SavePlayer(playerid)
{
    if(!PlayerLogged[playerid])
        return 0;

    UserStats[playerid][moneysave] = GetPlayerMoney(playerid);

    new string[512];
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    format(string, sizeof(string), "UPDATE users SET adminlevel='%d',money='%d',kill='%d',death='%d',score='%d',interior='%d' WHERE username='%s'", UserStats[playerid][admin], UserStats[playerid][moneysave], UserStats[playerid][kills], UserStats[playerid][deaths], UserStats[playerid][score], UserStats[playerid][interior], UserStats[playerid][name]);
    mysql_query(string);
    format(string, sizeof(string), "UPDATE users SET boss='%s',classid='%d',x='%f',y='%f',z='%f',health='%f' WHERE username='%s'", UserStats[playerid][boss], UserStats[playerid][gang], x, y, z, UserStats[playerid][healthsave], UserStats[playerid][name]);
    mysql_query(string);
    return 1;
}
And when i exit the game, i realize there is something wrong in it (The login and register stuff already work anyway). Look at this error message in server.log:

Код:
[MySQL] 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 kill='0',death='0',score='0',interior='0' WHERE username='VirSpector' at line 1.
I already check if there is something wrong in database, and there isn't! What's wrong??
Reply


Messages In This Thread
Problem MySQL Save Player - by VirSpectorX - 25.12.2010, 11:50
Re: Problem MySQL Save Player - by VirSpectorX - 25.12.2010, 12:13
Re: Problem MySQL Save Player - by playbox12 - 25.12.2010, 12:51
Re: Problem MySQL Save Player - by VirSpectorX - 26.12.2010, 10:24
Re: Problem MySQL Save Player - by exDDDD - 11.02.2011, 18:48

Forum Jump:


Users browsing this thread: 1 Guest(s)