AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [MYSQL] No more results in handle * (https://forums.alliedmods.net/showthread.php?t=24661)

v3x 02-28-2006 08:11

[MYSQL] No more results in handle *
 
I'm getting these errors in the logs:
Code:

L 02/28/2006 - 07:00:09: [MYSQL] No more results in handle 5
L 02/28/2006 - 07:00:09: [AMXX] Displaying debug trace (plugin "freegun2.amxx")
L 02/28/2006 - 07:00:09: [AMXX] Run time error 10: native error (native "dbi_result")
L 02/28/2006 - 07:00:09: [AMXX]    [0] freegun2.sma::get_user_hours (line 433)
L 02/28/2006 - 07:00:09: [AMXX]    [1] freegun2.sma::CheckSpawn (line 365)
L 02/28/2006 - 07:00:16: [MYSQL] No more results in handle 0
L 02/28/2006 - 07:00:16: [AMXX] Displaying debug trace (plugin "freegun2.amxx")
L 02/28/2006 - 07:00:16: [AMXX] Run time error 10: native error (native "dbi_result")
L 02/28/2006 - 07:00:16: [AMXX]    [0] freegun2.sma::get_user_hours (line 433)
L 02/28/2006 - 07:00:16: [AMXX]    [1] freegun2.sma::CheckSpawn (line 365)
L 02/28/2006 - 07:00:17: [MYSQL] No more results in handle 1
L 02/28/2006 - 07:00:17: [AMXX] Displaying debug trace (plugin "freegun2.amxx")
L 02/28/2006 - 07:00:17: [AMXX] Run time error 10: native error (native "dbi_result")
L 02/28/2006 - 07:00:17: [AMXX]    [0] freegun2.sma::get_user_hours (line 433)
L 02/28/2006 - 07:00:17: [AMXX]    [1] freegun2.sma::CheckSpawn (line 365)
L 02/28/2006 - 07:00:21: [MYSQL] No more results in handle 2
L 02/28/2006 - 07:00:21: [AMXX] Displaying debug trace (plugin "freegun2.amxx")
L 02/28/2006 - 07:00:21: [AMXX] Run time error 10: native error (native "dbi_result")
L 02/28/2006 - 07:00:21: [AMXX]    [0] freegun2.sma::get_user_hours (line 433)
L 02/28/2006 - 07:00:21: [AMXX]    [1] freegun2.sma::CheckSpawn (line 365)

and here's the function "get_user_hours":
Code:
public get_user_hours(id) {   new szAuthID[33];   get_user_authid(id , szAuthID , 32);   result = dbi_query(dbc , "SELECT * FROM `%s` WHERE `authid` = '%s'" , TABLE_USERS , szAuthID);   if(result == RESULT_NONE) {     new szUserName[33] , szAuthID[33];     get_user_name(id , szUserName , 32);     get_user_authid(id , szAuthID , 32);     dbi_query(dbc , "INSERT INTO `%s` (authid , name , time ) VALUES ('%s' , '%s' , '0')" , TABLE_USERS , szAuthID , szUserName);     return 0;   }     new tmp;   dbi_result(result , "time" , tmp); // line 365   dbi_free_result(result);   tmp /= 60;   tmp /= 60;   if(tmp <= 0)     return 0;   return tmp; }
Help would be appreciated seeming how `nobody` is on IRC at the moment. Thanks.

PM 02-28-2006 08:32

hello; i am pm

I've just read this other post with FakeNatives and whatnot and BAIL said you need dbi_nextrow or something there so you might want to check that out.




pm


edit: be sure to check out the example here
edit2: which I don't like because it doesn't handle errors properly :(

v3x 02-28-2006 09:02

Oh why thank you PM :o

Maybe someone else could provide a better example?

Sandurr 02-28-2006 10:47

isn't it
Code:
tmp = dbi_field(result , "time");

instead of
Code:
dbi_result(result , "time" , tmp); // line 365

Freecode 02-28-2006 15:55

Edit this
Code:
if(result == RESULT_NONE) {
to this
Code:
if(result == RESULT_NONE || !dbi_nextrow(result) ) {


All times are GMT -4. The time now is 20:28.

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