SA-MP Forums Archive
mysql_function_query new - 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: mysql_function_query new (/showthread.php?tid=647768)



mysql_function_query new - pulsare - 10.01.2018

How to write mysql_function_query today? (newest mysql plugin)

And how to turn cache to True / False ?


Re: mysql_function_query new - RIDE2DAY - 10.01.2018

You should update to the R40 version, you can follow my tutorial if you wish. Nowadays the MySQL plugin uses threaded queries, the functions are mysql_tquery and mysql_pquery. Queries sent with mysql_tquery are queued and they execute in the order you send them. On the other hand, mysql_pquery queries run at once.
PHP код:
// mysql_tquery
mysql_tquery(db_handle"SELECT * FROM `vehicles`"OnVehiclesLoad); // The vehicles load first.
mysql_tquery(db_handle"SELECT * FROM `houses`"OnHousesLoad); // The houses load after the vehicles. 
PHP код:
// mysql_pquery
mysql_pquery(db_handle"SELECT * FROM `vehicles`"OnVehiclesLoad);
mysql_pquery(db_handle"SELECT * FROM `houses`"OnHousesLoad);
// In this case the houses might load before the vehicles, you can't control the execution order here. 
Despite the above, you can still use unthreaded queries making use of mysql_query. In my opinion, you shoud use threaded queries along with the cache functions.