Raised This Month: $ Target: $400
 0% 

Threaded query


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
sparkey
Senior Member
Join Date: May 2010
Old 10-14-2010 , 10:27   Re: Threaded query
Reply With Quote #5

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(mysqlIp127"SELECT id,port FROM %s WHERE ip = '%s' LIMIT 1"MYSQL_SERVER_TABLEip);
    
SQL_ThreadQuery(g_SqlTuple"QueryStartup"mysqlIpip21);
    
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_PREFIXErrorErrcode);
        return;
    }
    if (
FailState == TQUERY_QUERY_FAILED)
    {
        
server_print("[%s]%s Error executing Query: %s (%s)"log_time(), SERVER_PREFIXErrorErrcode);
        return;
    }
    if (!
SQL_MoreResults(query))
        return;
 
    
serverid SQL_ReadResult(query0);
    
ghost_port SQL_ReadResult(query1);
    
server_print("[%s]%s OK! Fetched the address %s."log_time(), SERVER_PREFIXip);
 
    
//// HERE I HAVE TO DO THE COMPARING FOR EXAMPLE IF ghost_port != BLA BLA THEN KICK? ////
 

Hope you can see what i mean
sparkey is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode