help mysql update
#2

Somewhere at the top
pawn Код:
#define TABLE_NAME "[table name here]"
new pDeath[MAX_PLAYERS];
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        pDeath[playerid]++;
    }
}

public OnPlayerDisconnect(playerid)
{
    // make sure you have already connected to the database
    new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name));
    mysql_query("UPDATE %s SET death = '%d' WHERE name = '%s'", TABLE_NAME, pDeath[playerid], name);
}
Reply


Messages In This Thread
help mysql update - by TheBluec0de - 30.10.2011, 20:50
Re: help mysql update - by Pinguinn - 30.10.2011, 20:57
Re: help mysql update - by TheBluec0de - 31.10.2011, 11:38
Re: help mysql update - by [NoV]LaZ - 31.10.2011, 13:35
Re: help mysql update - by TheBluec0de - 31.10.2011, 14:55
Re: help mysql update - by TheBluec0de - 31.10.2011, 16:09
Respuesta: help mysql update - by GantaIgarashi - 31.10.2011, 16:27
Re: help mysql update - by TheBluec0de - 31.10.2011, 16:33
Re: help mysql update - by TheBluec0de - 31.10.2011, 17:21
Re: help mysql update - by TheBluec0de - 31.10.2011, 18:17

Forum Jump:


Users browsing this thread: 2 Guest(s)