Raised This Month: $ Target: $400
 0% 

[HELP]Invalid dbi handle 0


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dxteam
Senior Member
Join Date: Dec 2005
Old 01-17-2009 , 19:35   [HELP]Invalid dbi handle 0
Reply With Quote #1

i have this error and don`t know how to fix that..
Code:
L 01/18/2009 - 02:26:25: [MySQL] Invalid DBI handle 0
L 01/18/2009 - 02:26:25: [AMXX] Displaying debug trace (plugin "reg.amxx")
L 01/18/2009 - 02:26:25: [AMXX] Run time error 10: native error (native "dbi_query")
L 01/18/2009 - 02:26:25: [AMXX]    [0] module.inc::login (line 478)
L 01/18/2009 - 02:26:25: [AMXX]    [1] module.inc::client_infochanged (line 384)
L 01/18/2009 - 02:26:33: [MySQL] Invalid DBI handle 0
L 01/18/2009 - 02:26:33: [AMXX] Displaying debug trace (plugin "reg.amxx")
L 01/18/2009 - 02:26:33: [AMXX] Run time error 10: native error (native "dbi_query")
L 01/18/2009 - 02:26:33: [AMXX]    [0] module.inc::login (line 478)
L 01/18/2009 - 02:26:33: [AMXX]    [1] module.inc::client_infochanged (line 384)
-----------------------------
login script 473-492 strings

PHP Code:
public login(name[],pass[])
{
    new 
hash[34]
    
md5(pass,hash)
    {
        new 
Result:result dbi_query(gMySQL,"SELECT * FROM %s WHERE name like '%s' and pass like BINARY '%s'"USER_TABLEnamehash)
        if(
result <=RESULT_FAILED)
        {
            
dbi_free_result(result)
            return 
1
        
}
        
result dbi_query(gMySQL,"SELECT * FROM %s WHERE name like '%s' and pass like BINARY '%s'"WAITING_TABLEnamehash)
        if(
result <=RESULT_FAILED)
        {
            
dbi_free_result(result)
            return -
2
        
}
    }
    return -
1

client_infochanged 374-397 strings

PHP Code:
public client_infochanged(id)
{
    new 
newName[32], oldName[32], pass[35], details[2], bool:changeName false
    get_user_name
(id,oldName,31)
    
get_user_info(id"name"newName,31)
    
get_user_info(idPASSWORD_FIELDpass34)
    
details[0] = id

    
if(!equali(oldName,newName))
        
changeName true
    
if (login(newNamepass) > 0)
    {
        if(
changeName)
            
set_task(5.0,"completeLoginWrapper",470+id,details,1)
        return 
PLUGIN_CONTINUE
    
}

    if(
contain(newNameRESERVED_UNREGISTERED_TEXT) == -1)
    {        
        
server_cmd("kick #%d Register to access this server."get_user_userid(id))
    }

    return 
PLUGIN_CONTINUE

dxteam is offline
Send a message via ICQ to dxteam
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 01-17-2009 , 21:06   Re: [HELP]Invalid dbi handle 0
Reply With Quote #2

Quote:
if(result <=RESULT_FAILED)
to
Quote:
if(result > RESULT_NONE)
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
dxteam
Senior Member
Join Date: Dec 2005
Old 01-18-2009 , 12:40   Re: [HELP]Invalid dbi handle 0
Reply With Quote #3

Doesn`t work =(
I attach this plugin.
When i start dedicated server and connect, plugin doesn`t work and send error:

Code:
L 01/18/2009 - 19:36:56: [MySQL] Invalid DBI handle 0
L 01/18/2009 - 19:36:56: [AMXX] Displaying debug trace (plugin "userregver3.amxx")
L 01/18/2009 - 19:36:56: [AMXX] Run time error 10: native error (native "dbi_query")
L 01/18/2009 - 19:36:56: [AMXX]    [0] userregver3.sma::login (line 245)
L 01/18/2009 - 19:36:56: [AMXX]    [1] userregver3.sma::client_infochanged (line 151)
L 01/18/2009 - 19:36:56: [MySQL] Invalid DBI handle 0
L 01/18/2009 - 19:36:56: [AMXX] Displaying debug trace (plugin "userregver3.amxx")
L 01/18/2009 - 19:36:56: [AMXX] Run time error 10: native error (native "dbi_query")
L 01/18/2009 - 19:36:56: [AMXX]    [0] userregver3.sma::login (line 245)
L 01/18/2009 - 19:36:56: [AMXX]    [1] userregver3.sma::client_infochanged (line 151)
L 01/18/2009 - 19:36:58: [MySQL] Invalid DBI handle 0
L 01/18/2009 - 19:36:58: [AMXX] Displaying debug trace (plugin "userregver3.amxx")
L 01/18/2009 - 19:36:58: [AMXX] Run time error 10: native error (native "dbi_query")
L 01/18/2009 - 19:36:58: [AMXX]    [0] userregver3.sma::login (line 245)
L 01/18/2009 - 19:36:58: [AMXX]    [1] userregver3.sma::client_infochanged (line 151)
-----------------------------
But when i restart server plugin work correctly!! When i change map plugin work correctly.It don`t work when i start a dedicated server.
Someone please help.

Last edited by dxteam; 01-19-2009 at 06:19.
dxteam is offline
Send a message via ICQ to dxteam
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 01-18-2009 , 22:35   Re: [HELP]Invalid dbi handle 0
Reply With Quote #4

What do you want to hash with the results, name exists in the db or not?

iīm not really expired with dbi, but try:
PHP Code:
public login(name[],pass[]) 

    new 
hash[34
    
md5(pass,hash
    { 
        new 
Result:result dbi_query(gMySQL,"SELECT * FROM %s WHERE name like '%s' and pass like BINARY '%s'"USER_TABLEnamehash
        if(
result <= RESULT_NONE
        { 
            
dbi_free_result(result
            return 

        
}
        
result dbi_query(gMySQL,"SELECT * FROM %s WHERE name like '%s' and pass like BINARY '%s'"WAITING_TABLEnamehash
        if(
result <= RESULT_NONE
        { 
            
dbi_free_result(result
            return -

        
}
    } 
    return -


also what i always do: open sql_init() from plugin_cfg() with a little delay (like 0.5)
PHP Code:
public plugin_cfg()
{
   
set_task(0.5,"sql_init")
}
public 
sql_init()
{
... 
so you can make sure all cvars loaded
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who donīt.

Last edited by |PJ| Shorty; 01-18-2009 at 23:00.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
dxteam
Senior Member
Join Date: Dec 2005
Old 01-19-2009 , 06:19   Re: [HELP]Invalid dbi handle 0
Reply With Quote #5

thx for helping |PJ| Shorty!!!
I find solution for this error.
dxteam is offline
Send a message via ICQ to dxteam
Reply



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 01:54.


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