Raised This Month: $ Target: $400
 0% 

[HELP]Invalid dbi handle 0


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
|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 #1

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
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