Problem with syntax "TIME" on MySQL.
#6

As you see TotalGameTime returns PlayerInfo[ playerid ][ TotalTime ], you should save that one and order players by its value.
pawn Код:
public OnPlayerDisconnect(playerid, reason) {
    new query[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    format(query,128,"UPDATE Accounts SET totaltime = %d WHERE nickname = '%s'",TotalGameTime(playerid),name);
    mysql_query(query);
    return 1;
}
As you see I used totaltime, a simple integer.
Then for the Top.
pawn Код:
mysql_query("SELECT nickname FROM accounts ORDER BY totaltime LIMIT 5");
LIMIT 5 is the max rows will be returned, I mean, 5 players.
Reply


Messages In This Thread
Problem with syntax "TIME" on MySQL. - by Edvin - 04.11.2012, 11:48
Re: Problem with syntax "TIME" on MySQL. - by Edvin - 04.11.2012, 12:10
Re: Problem with syntax "TIME" on MySQL. - by [DOG]irinel1996 - 04.11.2012, 12:21
Re: Problem with syntax "TIME" on MySQL. - by Vince - 04.11.2012, 12:40
Re: Problem with syntax "TIME" on MySQL. - by Edvin - 04.11.2012, 12:45
Re: Problem with syntax "TIME" on MySQL. - by [DOG]irinel1996 - 04.11.2012, 12:49
AW: Problem with syntax "TIME" on MySQL. - by Skimmer - 04.11.2012, 12:50
Re: AW: Problem with syntax "TIME" on MySQL. - by Edvin - 04.11.2012, 12:59
AW: Problem with syntax "TIME" on MySQL. - by Skimmer - 04.11.2012, 13:11

Forum Jump:


Users browsing this thread: 2 Guest(s)