SA-MP Forums Archive
Query not save to mysql - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Query not save to mysql (/showthread.php?tid=631107)



Query not save to mysql - SilverStand - 23.03.2017

pawn Код:
Save_pData(playerid)
{
    if (pData[playerid][IsLoggedIn] == false) return 0;
    if(IsPlayerConnected(playerid))
    {
        GetPlayerPos(playerid, pData[playerid][X_Pos], pData[playerid][Y_Pos], pData[playerid][Z_Pos]);
        GetPlayerFacingAngle(playerid, pData[playerid][A_Pos]);
       
        new query[1024];
        format(query, sizeof(query), "UPDATE `playerdata` SET");
        format(query, sizeof(query), "%s `money` = %d,", query, pData[playerid][Money]);
        format(query, sizeof(query), "%s `adminlevel` = %d,", query, pData[playerid][Level]);
        format(query, sizeof(query), "%s `viplevel` = %d,", query, pData[playerid][VIPLevel]);
        format(query, sizeof(query), "%s `kills` = %d,", query, pData[playerid][Kills]);
        format(query, sizeof(query), "%s `deaths` = %d,", query, pData[playerid][Deaths]);
        format(query, sizeof(query), "%s `score` = %d,", query, pData[playerid][Score]);
        format(query, sizeof(query), "%s `interior` = %d,", query, pData[playerid][Interior]);
        format(query, sizeof(query), "%s `x` = %f,", query, pData[playerid][X_Pos]);
        format(query, sizeof(query), "%s `y` = %f,", query, pData[playerid][Y_Pos]);
        format(query, sizeof(query), "%s `z` = %f,", query, pData[playerid][Z_Pos]);
        format(query, sizeof(query), "%s `a` = %f", query, pData[playerid][A_Pos]);
        format(query, sizeof(query), "%s WHERE `id` = %d", query, pData[playerid][ID]);

        mysql_format(Koneksi, query, sizeof(query), "%s", query);
        mysql_tquery(Koneksi, query);
    }
    return 1;
}
i tried to /savestats but not stored to mysql data..
u wills save my life if u help me xD


Re: Query not save to mysql - X337 - 23.03.2017

Is there any warning/error in your mysql log?


Re: Query not save to mysql - SilverStand - 23.03.2017

fixed.