how to make a ranking in php? [closed]

1

[Help] ranking in .php file

illustrative image: link

site image (main page): link

image of accounts created for testing: link

I use Xamp, to display the created accounts I'll have to go to localhost / phpmyadmin. Good personal I made a designate for the ranking of the best five, I want to appear this ranking in the main page of the Site. Using sql for data storage of players count, this ranking is to show the top rank in level. Thanks in advance

    
asked by anonymous 21.08.2018 / 03:58

1 answer

2

The ideal is to make it clear which platform you are using, because anyone who does not play this game will not know what they are related to.

Gesior ACC

Recent versions of Gesior Acc have this sidebar indicating the ranking, it is not necessary to redo the query , just change directly in the ranking file.

If your version does not have this feature by default, you will need a method in some existing class to list the top 5.

query

SELECT name, level FROM accounts ORDER BY level ASC LIMIT 5

Examples

If you do not know how the project structure works, just take a look at GitHub (unofficial, if there is an official).

In this (community) version in the /pages/ folder in the highscores.php file, you have everything you need.

snippet of information

$skills = new Highscores($id, 100, $page, $world_id, $vocation);
    
21.08.2018 / 04:14