Virtue Posted June 30, 2013 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
Patskie Posted July 1, 2013 Posted July 1, 2013 For what reason? you just need the data and not the column name Quote
Mootie Posted July 1, 2013 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
Euphy Posted July 1, 2013 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
Mootie Posted July 1, 2013 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
Patskie Posted July 1, 2013 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
Emistry Posted July 1, 2013 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
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.
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.