MySQL Problems [REP+]
#8

PHP код:
stock SaveData(playerid)
{
    new 
query[128];
    
mysql_format(mysqlquerysizeof(query), "UPDATE `playerdata` SET `Admin`=%d, `VIP`=%d, `Money`=%d, `Helper`=%d, `Kills`=%d, `Deaths`=%d WHERE #account_id# = %d",\
    
PlayerData[playerid][pAdmin], PlayerData[playerid][pVIP], PlayerData[playerid][pCash], PlayerData[playerid][pHelper], PlayerData[playerid][pKills], PlayerData[playerid][pDeaths], #AccountID#);
    
mysql_tquery(mysqlquery"""");
    return 
1;

Add a WHERE statement to tell the constructor which row should be updated. It should be the account ID or the username, whichever you use.

The mysql_tquery is fine.
Reply


Messages In This Thread
MySQL Problems [REP+] - by SecretBoss - 13.07.2015, 13:38
Re: MySQL Problems [REP+] - by shadowdog - 13.07.2015, 13:52
Re: MySQL Problems [REP+] - by SecretBoss - 13.07.2015, 14:01
Re: MySQL Problems [REP+] - by shadowdog - 13.07.2015, 14:33
Re: MySQL Problems [REP+] - by SecretBoss - 13.07.2015, 14:34
Re: MySQL Problems [REP+] - by Scott Zulkifli - 13.07.2015, 14:41
Re: MySQL Problems [REP+] - by SecretBoss - 13.07.2015, 14:44
Re: MySQL Problems [REP+] - by shadowdog - 13.07.2015, 14:45

Forum Jump:


Users browsing this thread: 1 Guest(s)