Posts: 68
Threads: 7
Joined: Oct 2014
Quote:
Originally Posted by Konstantinos
All can be done in 1 query and you don't need formatting (the query) too. When selecting 1 field, the fieldid would be 0 and not 5.
PHP код:
new rank_info[200], player_name[MAX_PLAYER_NAME], DBResult: result = db_query(Database, "SELECT `NAME`,`RANK` FROM `USERS` ORDER BY `RANK` DESC limit 10");
for (new a; db_next_row(result) != 0; a++)
{
db_get_field(result, 0, player_name, sizeof player_name);
format(rank_info, sizeof(rank_info), "%d. %s - Rank: %d", a + 1, player_name, db_get_field_int(result, 1));
// client message
}
db_free_result(result);
// or dialog..
|
Oh thanks, now it's working but doesn't show the higher one from the DB:
I should be the first on the list but I don't appear there :V