Raised This Month: $ Target: $400
 0% 

Threaded query


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 10-14-2010 , 12:48   Re: Threaded query
Reply With Quote #6

You are right. The query runs in its own thread, and it won't print variable directly after SQL_ThreadQuery. You need to do the comparison and print it in QueryStartup function.

Also you don't need to check twice for errors:
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;
    }
    
//CODE ...

-->
PHP Code:
public QueryStartup(FailState,Handle:query,Error[],Errcode,ip[],DataSize)
    if(
FailState){
        
log_amx("SQL Error: %s (%d)"ErrorErrcode);
        return;
    }
    
//CODE ...

__________________
Impossible is Nothing
Sylwester 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