07.05.2016, 11:24
pawn Код:
new Cache:result, rows;
result = mysql_query(connection_handle, "SELECT score, username FROM usertable ORDER BY score DESC LIMIT 10");
if((rows = cache_num_rows(result)))
{
new id, score, username[MAX_PLAYER_NAME + 1];
for(new i=0; i < rows; i++)
{
score = cache_get_row_int(i, 0);
cache_get_row(i, 1, username);
printf("Position %d: Username - %s | Score: %d", ++id, username, score);
}
}
cache_delete(result);