The thing about your code is that:
You use variable
i incorrectly. It's used as the index of a player, where it alone just represents an index in the Players[] array. So using for instance; name[i] would be incorrect, whereas using name[players[i]] would be correct. Even better:
Code:
new player = players[i];
name[player] = ...
That would use less resources.
You could also try using threaded queries (note that they are based on a FIFO (first-in-first-out) basis; meaning that they stack up and wait for execution):
Code:
new const Host[ ] = "";
new const User[ ] = "";
new const Pass[ ] = "";
new const DB[ ] = "";
new Handle:SQLTuple;
SQLTuple = SQL_MakeDbTuple( Host, User, Pass, DB );
new Query[ 128 ];
formatex( Query, charsmax( Query ), "QUERY GOES HERE" );
SQL_ThreadQuery( SQLTuple, "QueryHandler", Query /*, ... data, datasize */);
public QueryHandler( Failstate, Handle:Query, Error[], ErrorCode, Data[], Size, Float:QueueTime )
{
if( Failstate == TQUERY_CONNECT_FAILED
|| Failstate == TQUERY_QUERY_FAILED )
{
log_amx( "SQL Error: %s (%i)", Error, ErrorCode );
return;
}
}
__________________