Total Registered Players - MYSQL
#1

Hi! Can somebody tell me a function in mysql which can count the number of players from the database? +REP
Reply
#2

You could use COUNT() Like this:
PHP Code:
SELECT COUNT(*) FROM accounts 
I think you also can use "mysql_num_rows" and do something like this:
pawn Code:
mysql_query("SELECT * FROM accounts");
mysql_store_result();
new rows = mysql_num_rows();
mysql_free_result();
 
printf("There are %d accounts",rows);
Reply
#3

pawn Code:
mysql_query("SELECT COUNT(`Username`) FROM Accounts");
Wouldn't this be better in terms of speed.
Reply
#4

Thx
Reply
#5

This works better

PHP Code:
SELECT COUNT(*) FROM accounts 
Reply
#6

Can somebody tell me how to make it in normal example in Y_INI?
Reply
#7

I know that I'm bumping an old topic, but how will this work for R33 plugin ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)