fantastic, works like a charm.
Let me just ask so i got this straight.
If i for example executes the threadquery it runs on its own thread the the code itself continues to run?
If i for example does this and tries to print the variable that i sets in the QueryStartup function directly after the SQL_ThreadQuery it wont print? So i have to do all the comparing in the SQL_ThreadQuery function?
PHP Code:
formatex(mysqlIp, 127, "SELECT id,port FROM %s WHERE ip = '%s' LIMIT 1", MYSQL_SERVER_TABLE, ip);
SQL_ThreadQuery(g_SqlTuple, "QueryStartup", mysqlIp, ip, 21);
server_print("ghost_port: %d.",ghost_port);
PHP Code:
public QueryStartup(FailState,Handle:query,Error[],Errcode,ip[],DataSize)
{
if (FailState == TQUERY_CONNECT_FAILED)
{
server_print("[%s]%s Error connecting to SQL: %s (%s)", log_time(), SERVER_PREFIX, Error, Errcode);
return;
}
if (FailState == TQUERY_QUERY_FAILED)
{
server_print("[%s]%s Error executing Query: %s (%s)", log_time(), SERVER_PREFIX, Error, Errcode);
return;
}
if (!SQL_MoreResults(query))
return;
serverid = SQL_ReadResult(query, 0);
ghost_port = SQL_ReadResult(query, 1);
server_print("[%s]%s OK! Fetched the address %s.", log_time(), SERVER_PREFIX, ip);
//// HERE I HAVE TO DO THE COMPARING FOR EXAMPLE IF ghost_port != BLA BLA THEN KICK? ////
}
Hope you can see what i mean