No active cache
#1

Hello.


I send a query and then loop through all the rows:
pawn Code:
for(new i; i < cache_get_row_count(); i++)
                            {  
                                new name[MAX_PLAYER_NAME];
                                cache_get_row(i,1,name);
                                format(query,sizeof(query),"%s\t%d min љią savaitę\n",query,GetPlayerXpThisWeek(cache_get_row_int(i,0)));
                            }
But the function "GetPlayerXpThisWeek" sends a query of its' own(non threaded aswell).
pawn Code:
stock GetPlayerXpThisWeek(sqlid)
{
    new query[70],int;
    format(query,sizeof(query),"SELECT SecondsThisWeek FROM job_experience WHERE UserId = %d",sqlid);
    new Cache:r = mysql_query(DbHandle,query);
    if(cache_get_row_count()) int = cache_get_row_int(0,0);
    cache_delete(r);
    return int;
}
So the loop only runs once (I printed out, there are more rows).. also this warning appears
pawn Code:
[21:24:24] [WARNING] cache_get_row_count - no active cache
Reply
#2

Show the query you send.
Reply
#3

pawn Code:
format(query,sizeof(query),"SELECT UserId,Username FROM users WHERE Job = %d",pInfo[playerid][Leader]);
                        new Cache:r = mysql_query(DbHandle,query);
Reply
#4

Which plugin are you using?
Reply
#5

BlueGs R34
Reply
#6

Quote:
Originally Posted by dusk
View Post
pawn Code:
format(query,sizeof(query),"SELECT UserId,Username FROM users WHERE Job = %d",pInfo[playerid][Leader]);
                        new Cache:r = mysql_query(DbHandle,query);
Change
pawn Code:
new Cache:r = mysql_query(DbHandle,query)
To
pawn Code:
mysql_tquery(DbHandle, query, false, "", "");
Reply
#7

That will just send a threaded query, which in this case is not what I want
Reply
#8

Actually, I did change it....(to mysql_tquery_inline to be precise) and the problem persists.
Reply
#9

Needs a callback! That is the whole point of threads. You CANNOT immediately retrieve a result after sending a query.
Reply
#10

I understand that Vince, that why I was sending unthreaded ones...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)