Quote:
Originally Posted by maddinat0r
The first active cache is the cache from the threaded query. You are overwriting this cache by sending an unthreaded query. Then you delete the cache from the unthreaded query, thus there is no active cache anymore.
The solution is to save the cache from the threaded query and always re-set it as active. However, this isn't a very good solution, I think your whole code can be improved with a JOIN LEFT query.
pawn Код:
public OnDMZoneLoad() { new query[50]; new Cache:thread_cache = cache_save(); for(new i; i < cache_get_row_count(); i++) { format(query,sizeof(query),"SELECT * FROM dm_area_points WHERE AreaId = %d",cache_get_row_int(i,0)); new Cache:r = mysql_query(DbHandle,query); if(cache_get_row_count()) { //something } cache_delete(r); cache_set_active(thread_cache); } cache_delete(thread_cache); return 1; }
And yes, 'cache_num_rows' is just a #define and is the same as 'cache_get_row_count'.
|
Thanks again, I ******d that "LEFT JOIN" thingy and it turned out to be as interesting as useful