AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Problem - Current result set has no fetched rows / plugin.sp::T_LoadData (https://forums.alliedmods.net/showthread.php?t=316410)

Lines08 05-21-2019 17:11

Problem - Current result set has no fetched rows / plugin.sp::T_LoadData
 
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;
    }
}
... 

https://i.imgur.com/SQQnhw4.png


what is wrong?

CliptonHeist 05-21-2019 19:32

Re: Problem - Current result set has no fetched rows / plugin.sp::T_LoadData
 
Not sure if this is the problem, but you can try moving SQL_FieldNameToNum() to after you fetch row.

Lines08 05-22-2019 10:58

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

Originally Posted by CliptonHeist (Post 2652586)
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



All times are GMT -4. The time now is 05:55.

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