MySQL doesn't update table?
#1

So I'm trying to learn MySQL, for some reason loading information into player seems to work fine, but updating the data when a player leaves doesn't.

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new query[512];
    new Float: tmpX, Float: tmpY, Float: tmpZ, Float: tmpA;

    GetPlayerPos(playerid, tmpX, tmpY, tmpZ);
    GetPlayerFacingAngle(playerid, tmpA);

    pData[playerid][p_SavePosInterior] = GetPlayerInterior(playerid);
    pData[playerid][p_SavePosVW] = GetPlayerVirtualWorld(playerid);

    mysql_format(mysql, query, sizeof query, "UPDATE `players` SET `AdminLevel`=%d `SavePos`=%d `SavePosX`=%f `SavePosY`=%f `SavePosZ`=%f `SavePosA`=%f `SavePosInterior`=%d `SavePosVW`=%d `Kills`=%d `Deaths`=%d \
                    `Score`=%d `Money`=%d WHERE ID=%d"
, pData[playerid][p_AdminLevel], pData[playerid][p_SavePos], tmpX, tmpY, tmpZ, tmpA,
                    pData[playerid][p_SavePosInterior], pData[playerid][p_SavePosVW], pData[playerid][p_Kills], pData[playerid][p_Deaths], GetPlayerScore(playerid), GetPlayerMoney(playerid), pData[playerid][p_ID]);

    mysql_tquery(mysql, query, "", "");
    return 1;
}
And generally, does anyone know any good place to start learning?
I've read so many tutorials on the forum, but it seems like none of them explains the BASIC of the language, making it really hard to understand.
Reply


Messages In This Thread
MySQL doesn't update table? - by [XST]O_x - 22.06.2015, 13:52
Re: MySQL doesn't update table? - by X337 - 22.06.2015, 13:58
Re: MySQL doesn't update table? - by [XST]O_x - 22.06.2015, 14:03
Re: MySQL doesn't update table? - by mamorunl - 22.06.2015, 14:17
Re: MySQL doesn't update table? - by [XST]O_x - 22.06.2015, 14:22
Re: MySQL doesn't update table? - by Konstantinos - 22.06.2015, 14:44
Re: MySQL doesn't update table? - by [XST]O_x - 22.06.2015, 14:50
Re: MySQL doesn't update table? - by zPain - 22.06.2015, 15:03
Re: MySQL doesn't update table? - by [XST]O_x - 22.06.2015, 15:07

Forum Jump:


Users browsing this thread: 2 Guest(s)