Raised This Month: $51 Target: $400
 12% 

Solved Run time error 10: (native "SQL_ReadResult") [Getting #Rank from database]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
heroicpower7613
Member
Join Date: Nov 2016
Old 07-03-2017 , 14:52   Run time error 10: (native "SQL_ReadResult") [Getting #Rank from database]
Reply With Quote #1

related topic here but its very unclear if there's a fix or not
https://forums.alliedmods.net/showth...t=68161&page=2

there's another plugin that shows rank with this plugin's native

errors:
Spoiler


code (i made a comment where the error line is):
Spoiler

Last edited by heroicpower7613; 07-05-2017 at 07:13.
heroicpower7613 is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 07-03-2017 , 17:13   Re: Run time error 10: (native "SQL_ReadResult") [Getting #Rank from database]
Reply With Quote #2

The errors you have is one error. The first line is the most important one.

Check if you have any result before trying to read it using SQL_NumResults().
__________________
Black Rose is offline
heroicpower7613
Member
Join Date: Nov 2016
Old 07-03-2017 , 22:29   Re: Run time error 10: (native "SQL_ReadResult") [Getting #Rank from database]
Reply With Quote #3

like this?
Code:
public Sql_Rank(FailState,Handle:Query,Error[],Errcode,Data[],DataSize) {     if(FailState == TQUERY_CONNECT_FAILED)         log_amx("Could not load - Error connecting to database. [%d] %s", Errcode, Error)     else if(FailState == TQUERY_QUERY_FAILED)         log_amx("Load Query failed. [%d] %s", Errcode, Error)             new id; id = Data[0];         if( !is_user_connected( id ) )     {         Rank[id] = 0;         return PLUGIN_HANDLED;     }         if( SQL_NumResults( Query ) > 1 )         Rank[id] = SQL_ReadResult(Query, 0);         return PLUGIN_HANDLED; }

i'll see if the error stops ty
heroicpower7613 is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 07-04-2017 , 06:02   Re: Run time error 10: (native "SQL_ReadResult") [Getting #Rank from database]
Reply With Quote #4

Now you require 2 or more results to read it. Perhaps > 0 or => 1 to include 1 result as well.
__________________
Black Rose is offline
heroicpower7613
Member
Join Date: Nov 2016
Old 07-04-2017 , 07:47   Re: Run time error 10: (native "SQL_ReadResult") [Getting #Rank from database]
Reply With Quote #5

yes haha I was just derping I did notice it.
btw shouldn't just this work too?
Code:
if( SQL_NumResults( Query ) )         Rank[id] = SQL_ReadResult(Query, 0);
heroicpower7613 is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 07-04-2017 , 15:20   Re: Run time error 10: (native "SQL_ReadResult") [Getting #Rank from database]
Reply With Quote #6

Unless that native doesn't return negative numbers on errors, yes.
__________________
Black Rose is offline
heroicpower7613
Member
Join Date: Nov 2016
Old 07-05-2017 , 07:15   Re: Run time error 10: (native "SQL_ReadResult") [Getting #Rank from database]
Reply With Quote #7

ok it's been few days and as far as I can tell this is fixed.
the error definitely should've occurred by now so thanks
heroicpower7613 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 02:02.


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