Query not save to mysql
#1

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
Reply


Messages In This Thread
Query not save to mysql - by SilverStand - 23.03.2017, 08:58
Re: Query not save to mysql - by X337 - 23.03.2017, 09:11
Re: Query not save to mysql - by SilverStand - 23.03.2017, 09:20

Forum Jump:


Users browsing this thread: 2 Guest(s)