Total Registered players. -
TheBosss - 22.02.2014
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!
Re: Total Registered players. -
Vince - 22.02.2014
PHP код:
SELECT COUNT(*) AS totalplayers FROM playerinfo
Re: Total Registered players. -
TheBosss - 22.02.2014
And i'll have to change just "playerinfo" with my tabel name?
And how is the full query?
Re: Total Registered players. -
Vince - 22.02.2014
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).
Re: Total Registered players. -
TheBosss - 22.02.2014
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?
Re: Total Registered players. -
TheBosss - 22.02.2014
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..
Re: Total Registered players. -
TheBosss - 23.02.2014
Please Help!
Re: Total Registered players. -
Scenario - 23.02.2014
Go read up on how to use MySQL in PAWN please. Clearly you have no idea.
Re: Total Registered players. -
ACI - 23.02.2014
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.
Re: Total Registered players. -
newbienoob - 23.02.2014
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.