No active cache - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: No active cache (
/showthread.php?tid=446509)
No active cache -
CrazyGab - 26.06.2013
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.
Re: No active cache -
MP2 - 26.06.2013
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!).
Re: No active cache -
CrazyGab - 26.06.2013
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.
Re: No active cache -
MP2 - 26.06.2013
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.
Re: No active cache -
CrazyGab - 26.06.2013
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.