Raised This Month: $ Target: $400
 0% 

SQLx module bug. How to avoid it?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
10000000
BANNED
Join Date: Oct 2009
Old 11-07-2009 , 14:29   SQLx module bug. How to avoid it?
Reply With Quote #1

Occurs something really weird. Lets suppose I got this code:
PHP Code:
public retrieve_bans(id)
{
    new 
error[512], errno
    
new Handle:sql SQL_Connect(g_infoerrnoerror127)
    new 
Handle:query
    
for(new pcount2 0pcount2 <= 4pcount2++)
    {
        
query SQL_PrepareQuery(sql,"SELECT `data6` FROM `characters` WHERE pj = '%s'"g_pj[pcount2][id])
        if (!
SQL_Execute(query))
        {
            
server_cmd("kick #%d ^"Servidor muy ocupado^""get_user_userid(id)) //kick him!
            
SQL_FreeHandle(query)
            
SQL_FreeHandle(sql)
            return 
PLUGIN_HANDLED
        
}
        else 
        {
            
SQL_NumResults(query)
            
g_pjban[pcount2][id] = SQL_ReadResult(query0)
        }
    }
    
SQL_FreeHandle(query)
    
SQL_FreeHandle(sql)
    return 
PLUGIN_HANDLED

Everything works fine.
But lets suppose I change the query from this
PHP Code:
query SQL_PrepareQuery(sql,"SELECT `data6` FROM `characters` WHERE pj = '%s'"g_pj[pcount2][id]) 
To this
PHP Code:
query SQL_PrepareQuery(sql,"SELECT `bantime` FROM `characters` WHERE pj = '%s'"g_pj[pcount2][id]) 
Everything should work fine, as it does when I insert that query direct into phpMyAdmin. I just get another value from another column. Weirdly, in SQLx module it throws an annoying error

Code:
L 11/07/2009 - 15:11:41: [MySQL] No result set in this query!
L 11/07/2009 - 15:11:41: [AMXX] Displaying debug trace (plugin "test.amxx")
L 11/07/2009 - 15:11:41: [AMXX] Run time error 10: native error (native "SQL_ReadResult")
Any idea of this weird bug?
10000000 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 17:47.


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