07.03.2014, 06:26
pawn Код:
mysql_function_query("SELECT ID FROM Accounts")
pawn Код:
CMD:...()
{
mysql_function_query(connectionHandle, "SELECT COUNT(ID) FROM Accounts", true, "OnReturnNums", "d", playerid);
}
forward OnReturnNums(playerid);
public OnReturnNums(playerid)
{
new rows, fields, Msg[40];
cache_get_data(rows, fields, connectionHandle);
format(Msg, sizeof(Msg), "Registered players: %i", rows);
SendClientMessage(playerid, -1, Msg);
return 1;
}
Use cache to get the data. Use COUNT() instead of SELECT * FROM to save memory and time.
I am assuming you know your connectionHandle and some code is assumed to be known.
Cheers