If you're using MySQL you can very easily select a top 5 based on certain data. For example, let's say we have this users table:\
Using this query:
This would select columns "name" and "kills" from the table "users" and order by kills, descending (DESC -- ASC would order ascending, and thus beginning with the lowest values). LIMIT 5 says: Limit to 5 results. The query itself should be pretty clear.
This would give this output:
Code:
+---+----------+------+-------+------
| id | name | kills | deaths | score |
+---+----------+------+-------+------
| 1 | Kwarde | 16 | 25 | 4 |
| 2 | Playa | 2 | 19 | 1 |
| 3 | Z3fRaN | 28 | 1 | 100 |
| 4 | Narf3z | 1 | 28 | 0 |
| 5 | MathPi | 99 | 0 | 50 |
| 6 | Slayer | 66 | 13 | 25 |
| 7 | JimmyPage | 0 | 2 | 0 |
+---+----------+------+-------+------
Code:
SELECT name, kills FROM users ORDER BY kills DESC LIMIT 5;
This would give this output:
Code:
+-------+------
| name | kills |
+-------+------
| MathPi | 99 |
| Slayer | 66 |
| Z3fRaN | 28 |
| Kwarde | 16 |
| Playa | 2 |
+-------+------