No active cache
#1

Well hello there! I've came across a problem that have been giving me headaches for quite awhile!
Basicly whenever I run this bit of code I get a mysql error saying "[10:19:01] [WARNING] cache_insert_id - no active cache"
Using the lates mysql revision.

Code:
		format(Query, sizeof(Query), "INSERT INTO houses (houseOwner, houseLocked) VALUES('Nobody', '1')");
		mysql_tquery(databaseConnection, Query, "", "");
		i = cache_insert_id();
And due to this the cache_insert_id returns 0...

There's an Auto Increment in the database and it contains all columns required.
Reply
#2

Are you using BlueG's mySQL plugin? If so, you'll have to use a callback for the threaded queries, and use mysql_insert_id() or cache_insert_id() there (mysql_insert_id now re-directs to cache_insert_id, so I assume you have to enable cache if you want the insertion ID!).
Reply
#3

Yeah I'm using BlueGs plugin, and well, seing r18(?) everysingle mysql query is cached, hence there's no false/true in the query.
And would you like to explain abit more indepth regarding the "callback for threaded queries" seing I'm a bit new to mysql.
Reply
#4

I have no idea what mysql_tquery does, as there seems to be no documentation on it AT ALL, which is a bit silly, but in mysql_function_query there's a bool:cache parameter, set that to true and then get the insert_id from the function/callback.
Reply
#5

Oh yeah, the BlueG's mysql topic is a bit outdated, you need to go to the ****** code web page for the later releases (r8+).
And well, he decided to make every single query cached so he changed mysql_function_query to mysql_tquery which is mysql_Function_query but without the bool:cache parameter seing the cache is always on.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)