Raised This Month: $32 Target: $400
 8% 

Problem - Current result set has no fetched rows / plugin.sp::T_LoadData


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lines08
Junior Member
Join Date: Sep 2014
Old 05-21-2019 , 17:11   Problem - Current result set has no fetched rows / plugin.sp::T_LoadData
Reply With Quote #1

Don't know what im doing wrong. for some reason it gives me this as error:

Code:
L 05/21/2019 - 22:56:06: [SM] Exception reported: Current result set has no fetched rows
L 05/21/2019 - 22:56:06: [SM] Blaming: sm.smx
L 05/21/2019 - 22:56:06: [SM] Call stack trace:
L 05/21/2019 - 22:56:06: [SM]   [0] SQL_FetchInt
L 05/21/2019 - 22:56:06: [SM]   [1] Line 151, plugin.sp::T_LoadData
line 151 is blank and has nothing in it

Source:

PHP Code:
...
public 
void OnClientPutInServer(int client)
{
    if(!
IsFakeClient(client) && g_Database != null)
    {
        
char query[256], steamid[32];
        
GetClientAuthId(clientAuthId_SteamID64steamidsizeof(steamid));
        
FormatEx(querysizeof(query), "SELECT * FROM userliste WHERE steam_id = '%s'"steamid);
        
SQL_TQuery(g_DatabaseT_LoadDataqueryGetClientUserId(client));
    }
}

public 
void T_LoadData(Handle ownerHandle results, const char[] errorany data)
{
    if(
owner == null || results == null)
    {
        
LogError("T_LoadData returned error: %s"error);
        return;
    }

    
int client GetClientOfUserId(data);

    if (
client == 0)
    {
      return;
    }
    
    
int playerRank;
    
int playerTwitchName;
    
SQL_FieldNameToNum(results"csgorank"playerRank);
    
SQL_FieldNameToNum(results"twitch_name"playerTwitchName);
    
    if(
SQL_FetchRow(results))
    {
      
g_iRank[client] = SQL_FetchInt(resultsplayerRank);
      
int userTwitchName SQL_FetchInt(resultsplayerTwitchName);
      
      
char name[32];
      
GetClientName(clientnamesizeof(name));
      
      
char alias[32];
      
Format(aliassizeof(alias), "[%s] %s"userTwitchNamename);
      
SetClientName(clientalias);
    }
    else
    {
      
PrintToChat(client"Could not find you in the DB.");
      return;
    }
}
... 



what is wrong?

Last edited by Lines08; 05-21-2019 at 18:08.
Lines08 is offline
CliptonHeist
Senior Member
Join Date: Feb 2016
Old 05-21-2019 , 19:32   Re: Problem - Current result set has no fetched rows / plugin.sp::T_LoadData
Reply With Quote #2

Not sure if this is the problem, but you can try moving SQL_FieldNameToNum() to after you fetch row.
CliptonHeist is offline
Lines08
Junior Member
Join Date: Sep 2014
Old 05-22-2019 , 10:58   Re: Problem - Current result set has no fetched rows / plugin.sp::T_LoadData
Reply With Quote #3

Quote:
Originally Posted by CliptonHeist View Post
Not sure if this is the problem, but you can try moving SQL_FieldNameToNum() to after you fetch row.
Hey, thanks for the idea but its still not working gives me the same error again:

Code:
L 05/22/2019 - 16:56:35: [SM] Exception reported: Current result set has no fetched rows
L 05/22/2019 - 16:56:35: [SM] Blaming: sm.smx
L 05/22/2019 - 16:56:35: [SM] Call stack trace:
L 05/22/2019 - 16:56:35: [SM]   [0] SQL_FetchInt
L 05/22/2019 - 16:56:35: [SM]   [1] Line 151, plugin.sp::T_LoadData
Lines08 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 12:28.


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