• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

top exp day

Dogrinha

New Member
Joined
Oct 6, 2019
Messages
206
Solutions
1
Reaction score
2
Does anyone have such a php script that shows the tops of experience gained per day? one that updates the exp daily, not just once, but once a day, so it always opens experience tops a day
1576592796270.png
otx2 gesior
 
Hello Dogrinha,

that will depend on how you save experience values to your database. I won't really help further on this task as OTX is just a big chaos and I don't really feel like going through messy code just for fun.

The php part shouldn't be hard, it's just a select query to your database.

It should look like this:
PHP:
$SQL->query('SELECT * FROM ' . $SQL->tableName('PLAYER_TABLE') . ' WHERE ' . $SQL->fieldName('GROUP_ID') . ' < 2 ORDER BY ' . $SQL->fieldName('TODAY_EXPERIENCE') . '-' . $SQL->fieldName('EXPERIENCE') . ' DESC LIMIT ' . $limit)->fetchAll();

You'll have to rename the following values PLAYER_TABLE, GROUP_ID, TODAY_EXPERIENCE and EXPERIENCE to your match your database schema.

Oh, by the way if you set the variable $limit to 5 the query will return only the 5 top players from that request, I really hope you understand the logic behind it.

Best Wishes
Okke
 
Back
Top