#2

pawn Код:
mysql_function_query("SELECT ID FROM Accounts")
is a threaded query. I am not sure if you can use store result, etc on that.

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
Reply


Messages In This Thread
Help - by Mriss - 07.03.2014, 06:20
Re: Help - by RajatPawar - 07.03.2014, 06:26
Re: Help - by Mriss - 07.03.2014, 06:28
Re: Help - by RajatPawar - 07.03.2014, 06:30
Re: Help - by Mriss - 07.03.2014, 06:33

Forum Jump:


Users browsing this thread: 1 Guest(s)