Total players registered - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Total players registered (
/showthread.php?tid=590833)
Total players registered -
Ugaustin - 04.10.2015
hi,can someone tell me how can I make MYSQL,by /123 , There are X player accounts.. but I don't know how..
Re: Total players registered -
Bartels - 04.10.2015
Could you provide some more information? I'm assuming you've got a MySQL database and want to count the player accounts? You can do that using MySQL's COUNT function.
Re: Total players registered -
Ugaustin - 04.10.2015
yes account name is "account" ... and im new,and I cant find tutorial for this kind,
Re: Total players registered -
d1git - 04.10.2015
What you want to do is... SELECT everything from the table ACCOUNTS and then use the inbuilt function; cache_get_row_count(); to get the number of rows.
PHP код:
new query[24];
mysql_format(connection, query, sizeof(query), "SELECT * FROM Accounts;");
mysql_tquery(connection, query, "CheckQuery1");
format CheckQuery1();
public CheckQuery1()
{
printf("Number of Accounts: %d.", cache_get_row_count());
}
Re: Total players registered -
Ugaustin - 04.10.2015
thanks!reped!
Re: Total players registered -
d1git - 04.10.2015
Deleted *Wrong quote*.
Re: Total players registered -
Ugaustin - 04.10.2015
it appears that are 0 accounts..don't know wghy..
Re: Total players registered -
d1git - 04.10.2015
What is the name of your SQL table that stores your accounts? Replace that with the SQL Query.
PHP код:
new query[24];
mysql_format(connection, query, sizeof(query), "SELECT * FROM SQLTableNameInsertHere;");
mysql_tquery(connection, query, "CheckQuery1");
format CheckQuery1();
public CheckQuery1()
{
printf("Number of Accounts: %d.", cache_get_row_count());
}
Re: Total players registered -
Ugaustin - 04.10.2015
forward or format??
format CheckQuery1(); ??
Re: Total players registered -
d1git - 04.10.2015
Quote:
Originally Posted by Ugaustin
forward or format??
format CheckQuery1(); ??
|
forward* my bad.