06.12.2013, 18:21
Hello.
I send a query and then loop through all the rows:
But the function "GetPlayerXpThisWeek" sends a query of its' own(non threaded aswell).
So the loop only runs once (I printed out, there are more rows).. also this warning appears
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)));
}
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;
}
pawn Code:
[21:24:24] [WARNING] cache_get_row_count - no active cache