Vietlubu Posted July 18, 2012 Posted July 18, 2012 i need 2 MySQL Query 1. filter all online players 2. filter all online accounts thank! Quote
Euphy Posted July 18, 2012 Posted July 18, 2012 query_sql("SELECT account_id FROM `char` WHERE online = 1 LIMIT 128;",.@accounts); Then to get player names, do a loop: rid2name(.@accounts[var]) 1 Quote
Myzter Posted July 18, 2012 Posted July 18, 2012 Chars: select char_id from `char` where online=1; Accounts: select l.account_id from `login` l join `char` c on l.account_id = c.account_id where c.online=1 The results can be more than 128 rows, use limit to restrict the row number using a page. set .@PageSize, 100; set .@Counter, 0; do { set .@Results, query_sql("select l.account_id from `login` l join `char` c on l.account_id = c.account_id where c.online=1 limit " + .@Page + "," + .@PageSize, .@accounts); for (set .@x,0; .@x < .@Results; set .@x, .@x + 1) { set .@Counter, .@Counter + 1; debugmes "Account #" + .@Counter + ": " + .@accounts[.@x]; } set .@Page, .@Page + .@PageSize; } while (.@Results); 1 Quote
Vietlubu Posted July 18, 2012 Author Posted July 18, 2012 thank you so much How to check server online or offline Quote
Euphy Posted July 18, 2012 Posted July 18, 2012 http://www.eathena.ws/board/index.php?showtopic=262327 Quote
Question
Vietlubu
i need 2 MySQL Query
1. filter all online players
2. filter all online accounts
thank!
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.