How to organize the drivers' list according to the pilot's number

Hello, I wonder how to keep the list of drivers in order according to their number, not according to rank, see the problem in the following image, the number of Riders: 0003 and 0004 were for the end they passed the rank .

I await answers, good night.

It should be by id.

You need to change your DB query to fetch data ordered by pilot ID. Try this:

$sql = "SELECT * FROM phpvms_pilots ORDER BY pilotid"

A better way to do this is adding the following in your core/local.config.php file:

Config::Set('PILOT_ORDER_BY', 'p.joindate ASC');

Resolved, I added the following line in the core / local.config.php file:

Config::Set(‘PILOT_ORDER_BY’, ‘pilotid’);

Thank you all