Raised This Month: $ Target: $400
 0% 

Invalid DBI result handle -1


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lieutenant
Junior Member
Join Date: Oct 2007
Location: US
Old 05-03-2011 , 22:36   Invalid DBI result handle -1
Reply With Quote #1

Hi, I have been having trouble getting data from my db. I usually get a "Invalid DBI error" I have tried making the "dbi_query" connection with SQLx but had no luck. Any hints would be greatly appreciated.

Heres the Error
PHP Code:
L 05/03/2011 21:03:28: [MySQLInvalid DBI result handle -1
L 05
/03/2011 21:03:28: [AMXXDisplaying debug trace (plugin "zp_sxg_bank.amxx")
L 05/03/2011 21:03:28: [AMXXRun time error 10native error (native "dbi_result")
L 05/03/2011 21:03:28: [AMXX]    [0zp_sxg_bank.sma::OnPlayerSpawn (line 773
PHP Code:
public OnPlayerSpawn(id)
{
    if(
client_authed[id])
    {
        if(
firstspawn[id])
        {
            if(
dbc 0)
            {
                new 
sid[35]
                
player_info[id][player_balance] = -1
                
if(get_pcvar_num(bank_use_ip))
                    
get_user_ip(id,sid,34)
                else
                    
get_user_authid(id,sid,34)
                
                
result dbi_query(dbc"SELECT * FROM `bank` WHERE `sid` = '%s'"sid)
                if(
result != RESULT_NONE)
                {
                    
//dbi_nextrow(result)
                    
player_info[id][player_balance] = dbi_result(result,"amount")
                    
player_info[id][special_ap] = dbi_result(result,"special_ap")
                    
play_bank[id][BANK_LIMIT] = dbi_result(result"bank_limit")
                    
play_bank[id][BANK_INTTIME] = dbi_result(result"interest_time")
                    
play_bank[id][BANK_INTEREST] = dbi_result(result"interest_rate")
                    
zp_set_user_ammo_packs(iddbi_result(result"pocket_ap"))
                }
                
dbi_free_result(result
            }
            
firstspawn[id] = false;
        }
            
    }

Lieutenant is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-03-2011 , 23:21   Re: Invalid DBI result handle -1
Reply With Quote #2

Use the new SQLx functions.
https://forums.alliedmods.net/showthread.php?t=46779
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
vi3tmofo
Member
Join Date: Jun 2009
Old 05-05-2011 , 20:46   Re: Invalid DBI result handle -1
Reply With Quote #3

good one
vi3tmofo is offline
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 04:27.


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