Vietlubu Posted July 18, 2012 Group: Members Topic Count: 36 Topics Per Day: 0.01 Content Count: 141 Reputation: 24 Joined: 01/19/12 Last Seen: March 30 Share Posted July 18, 2012 i need 2 MySQL Query 1. filter all online players 2. filter all online accounts thank! Quote Link to comment Share on other sites More sharing options...
Euphy Posted July 18, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share 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 Link to comment Share on other sites More sharing options...
Myzter Posted July 18, 2012 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 107 Reputation: 91 Joined: 01/19/12 Last Seen: April 19, 2024 Share 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 Link to comment Share on other sites More sharing options...
Vietlubu Posted July 18, 2012 Group: Members Topic Count: 36 Topics Per Day: 0.01 Content Count: 141 Reputation: 24 Joined: 01/19/12 Last Seen: March 30 Author Share Posted July 18, 2012 thank you so much How to check server online or offline Quote Link to comment Share on other sites More sharing options...
Euphy Posted July 18, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted July 18, 2012 http://www.eathena.ws/board/index.php?showtopic=262327 Quote Link to comment Share on other sites More sharing options...
Question
Vietlubu
i need 2 MySQL Query
1. filter all online players
2. filter all online accounts
thank!
Link to comment
Share on other sites
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.