06.12.2015, 11:21
(
Последний раз редактировалось Antonio144; 06.12.2015 в 15:55.
)
What's your database schema? You need to formulate an sql query.
1. SELECT `userName` from usersTable WHERE `userLevel` = 'admin'; and then check the usernames with usernames that are online. And then just make the textDraws (use wiki if you need help). BUT you should not do this through an sql. You should already have in your script some variable that holds online player's status (admin, vip, regular etc..) And just lopp through that.
EDIT: oh you didn't mean to get the data from database. But it still applies. Just loop through all the online players and check their level.
2. If you have the score it in the same table as users: SELECT `userName`, `score` from usersTable ORDER BY `score` DESC LIMIT 10; If not, you would need to use join statment or inline query.
But without knowing your database schema I can't form the correct query's.
1. SELECT `userName` from usersTable WHERE `userLevel` = 'admin'; and then check the usernames with usernames that are online. And then just make the textDraws (use wiki if you need help). BUT you should not do this through an sql. You should already have in your script some variable that holds online player's status (admin, vip, regular etc..) And just lopp through that.
EDIT: oh you didn't mean to get the data from database. But it still applies. Just loop through all the online players and check their level.
2. If you have the score it in the same table as users: SELECT `userName`, `score` from usersTable ORDER BY `score` DESC LIMIT 10; If not, you would need to use join statment or inline query.
But without knowing your database schema I can't form the correct query's.