Virtue Posted June 30, 2013 Group: Members Topic Count: 92 Topics Per Day: 0.02 Content Count: 354 Reputation: 22 Joined: 11/17/11 Last Seen: May 12, 2024 Share Posted June 30, 2013 Hi Scripting Pros, is it possible to use this query on a script? SELECT COUNT(account_id) AS OnlinePlayers FROM char WHERE online=1; I will be using it for some script that checks the online player count Thanks to those who will help. Quote Link to comment Share on other sites More sharing options...
Patskie Posted July 1, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 14 hours ago Share Posted July 1, 2013 For what reason? you just need the data and not the column name Quote Link to comment Share on other sites More sharing options...
Mootie Posted July 1, 2013 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 815 Reputation: 86 Joined: 10/26/12 Last Seen: June 10, 2022 Share Posted July 1, 2013 For what reason? you just need the data and not the column name Data..... what data? data folder? sql data? You can revise this script http://rathena.org/board/files/go/bd245e8b5202aa15932c5a1826e142fc/ingame-gm-list Quote Link to comment Share on other sites More sharing options...
Euphy Posted July 1, 2013 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 1, 2013 Yes, that query is valid. Alternately, you could just use the return value of Query_sql (or the array size, doesn't make much of a difference). Data..... what data? data folder? He's referring to the SQL data. Quote Link to comment Share on other sites More sharing options...
Mootie Posted July 1, 2013 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 815 Reputation: 86 Joined: 10/26/12 Last Seen: June 10, 2022 Share Posted July 1, 2013 Yes, that query is valid. Alternately, you could just use the return value of Query_sql (or the array size, doesn't make much of a difference). Data..... what data? data folder? sql data? He's referring to the SQL data. this? mysql_select_db($Srv_Database, $Connection); $query = "SELECT COUNT(*) as total FROM `char` WHERE online = '1'"; Quote Link to comment Share on other sites More sharing options...
Patskie Posted July 1, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 14 hours ago Share Posted July 1, 2013 For what reason? you just need the data and not the column name Do data folder have column name? Topic title already implies what my answer is all about Quote Link to comment Share on other sites More sharing options...
Emistry Posted July 1, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted July 1, 2013 something like this ? prontera,155,161,5 script Sample 757,{ query_sql( "SELECT `name` FROM `char` WHERE `online` = 1 LIMIT 128",.@name$ ); .@size = getarraysize( .@name$ ); while( .@i < .@size ){ if( !checkvending( .@name$[.@i ) ) .@count++; .@i++; } mes "Total "+.@count+" Player online without Vending."; mes "Total "+( .@size - .@count )+" Player online with Vending."; close; } my current script only limited to max 128 players...if you want to extend this.... you can try make use of OFFSET in the SQL statement ... Quote Link to comment Share on other sites More sharing options...
Question
Virtue
Hi Scripting Pros,
is it possible to use this query on a script?
I will be using it for some script that checks the online player count
Thanks to those who will help.
Link to comment
Share on other sites
6 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.