Total Registered players.
#1

Hello all,

Can somebody tell me how can i count all my registered players in the database?And if you can please give me an example!
P.S:For mysql plugin r37 please!
Reply
#2

PHP код:
SELECT COUNT(*) AS totalplayers FROM playerinfo 
Reply
#3

And i'll have to change just "playerinfo" with my tabel name?
And how is the full query?
Reply
#4

Yes, change the table name. Also, this is the full query. It will simply return a single row with a single field (called totalplayers) containing the number of rows. You can optionally extend this with a WHERE clause (to filter out banned players, for example) or a GROUP BY clause (to count normal players AND banned players, for example).
Reply
#5

Ok thanks..My main idea is to create an OnPlayerConnect textdraw wich shows the registered players.
So..should i make something like:
new myvar;
myvar = SELECT COUNT(*) AS totalplayers FROM playerinfo
And then the TextDrawSetString.
Should i do like that above?
Reply
#6

I'm not really good in this domain,but I tryed:
pawn Код:
new totalaccs;
    totalaccs = mysql_function_query( g_Handle, "SELECT COUNT(*) AS totalplayers FROM `Accounts`", false, "", "" );
new stringss[50];
format(stringss, 50, "Accounts Registered: %d",totalaccs);
TextDrawSetString(registered, stringss);
TextDrawShowForPlayer( playerid, registered );
And it shows that there is 1 registered account,but there are more..
Reply
#7

Please Help!
Reply
#8

Go read up on how to use MySQL in PAWN please. Clearly you have no idea.
Reply
#9

Quote:

Go read up on how to use MySQL in PAWN please. Clearly you have no idea.

Why dont you help him instead of saying so?

@ n00b - (I wont bump the topic) I know about the fish thing but he was rude.
Reply
#10

Quote:
Originally Posted by ACI
Посмотреть сообщение
Why dont you help him instead of saying so?
Give a man a fish and he will eat for a day; Teach a man to fish and he will eat for a lifetime.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)