Posts: 79
Threads: 11
Joined: Jan 2014
Reputation:
0
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!
Posts: 79
Threads: 11
Joined: Jan 2014
Reputation:
0
And i'll have to change just "playerinfo" with my tabel name?
And how is the full query?
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
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).
Posts: 79
Threads: 11
Joined: Jan 2014
Reputation:
0
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?
Posts: 7,801
Threads: 187
Joined: Feb 2010
Reputation:
0
Go read up on how to use MySQL in PAWN please. Clearly you have no idea.