Mysql LeaderBoard
#7

pawn Code:
mysql_query("SELECT username, score FROM `table` ORDER BY `score` DESC LIMIT 10");
mysql_store_result();
new num, top[10][24], score[10][10];
while(mysql_retrieve_row())
{
    mysql_fetch_field_row(top[num], "username");
    mysql_fetch_field_row(score[num], "score");
    num++;
}
mysql_free_result();
printf("Rank 1: %s with %d score, Rank 2: %s with %d score , Rank 3: %s with %d score, Rank 4: %s with %d score, Rank 5: %s with %d score, Rank 6: %s with %d score, Rank 7: %s with %d score, Rank 8: %s with %d score, Rank 9: %s, Rank 10: %s with %d score", top[0], score[0], top[1], strval(score[1]), top[2], strval(score[2]), top[3], strval(score[3]), top[4], strval(score[4]), top[5], strval(score[5]), top[6], strval( score[6]), top[7], strval(score[7]), top[8], strval(score[8]), top[9], strval(score[9]));
Reply


Messages In This Thread
Mysql LeaderBoard - by Lefon - 03.08.2011, 10:05
Re: Mysql LeaderBoard - by Vince - 03.08.2011, 10:14
Re: Mysql LeaderBoard - by Lefon - 03.08.2011, 10:16
Re: Mysql LeaderBoard - by GangsTa_ - 03.08.2011, 10:17
Re: Mysql LeaderBoard - by [HiC]TheKiller - 03.08.2011, 10:18
Re: Mysql LeaderBoard - by Lefon - 03.08.2011, 10:33
Re: Mysql LeaderBoard - by [HiC]TheKiller - 04.08.2011, 06:42

Forum Jump:


Users browsing this thread: 2 Guest(s)