22.02.2014, 11:05
Quote:
Thanks for the information. What transactions are we talking about?
Different question. I want to send one query in another ones function. If I do that I get this warning: pawn Код:
I would make the second query threaded, but I will need data from the first one... This has been on my mind for quite some time.. Or is my table design flawed? |
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;
}