09.05.2020, 09:58
Hello everybody, and before any of you go keyboard warrior mode, i did actually research it on ****** and found at least a dozen of posts, none of which actually helped my solve my issue, that's why I'm here.
Using the following code, i get the no active cache issue (cache_get_row_count: no active cache):
Thanks a lot!
Using the following code, i get the no active cache issue (cache_get_row_count: no active cache):
pawn Code:
LoadAvailableBounties(playerid)
{
new DB_Query[256];
mysql_format(Database, DB_Query, sizeof(DB_Query), "SELECT * FROM `player_bounties`");
mysql_tquery(Database, DB_Query, "LoadBounties", "i", playerid);
printf("%s", DB_Query); // the query is printed correctly
}
forward LoadBounties(playerid);
public LoadBounties(playerid)
{
if(cache_num_rows()>0) // the error line is here and fairly enough, only the first entry is shown in the dialog
{
new target, hitprice;
for(new i; i<cache_num_rows(); i++)
{
cache_get_value_int(i, "hitid", target);
cache_get_value_int(i, "amount", hitprice);
// some more code not mysql related
}
}
return 1;
}
CMD:bounties(playerid, params[])
{
LoadAvailableBounties(playerid);
return 1;
}