17.02.2014, 18:41
You always have to switch the active cache to the correctly saved one.
Yes, you have to free it manually (there isn't even a way to free it automatically).
pawn Code:
new Cache:a, Cache:b, Cache:c;
a = mysql_query(sql, "SELECT 2+2");
b = mysql_query(sql, "SELECT 3+3");
c = mysql_query(sql, "SELECT 4+4");
cache_set_active(b);
printf("3+3: %d", cache_get_row_int(0,0));
cache_set_active(a);
printf("2+2: %d", cache_get_row_int(0,0));
cache_set_active(c);
printf("4+4: %d", cache_get_row_int(0,0));
cache_delete(a);
cache_delete(b);
cache_delete(c);