13.12.2010, 22:25
How about making a function to call a custom callback upon a query being complete, working similar to CallLocalFunction?
mysql_thread_query(const query[], const callback[], const format[], {Float,_}:...)
Example:
mysql_query_callback("UPDATE Players SET registered = 1 WHERE name = 'Jay'", OnPlayerRegister, "d", playerid);
It would probably be possible to script a function for this in PAWN with the given functions but I'm sure this would be much better coded in C++. This would make threading much easier.
Also: It would be cool if mysql_store_result could store more than one result. It could work like SA:MP's native SQLite functions: Assigning a tagged variable to a query would automatically store the given result. This would make threading MUCH easier and eliminate the use for the store/free result natives.
mysql_thread_query(const query[], const callback[], const format[], {Float,_}:...)
Example:
mysql_query_callback("UPDATE Players SET registered = 1 WHERE name = 'Jay'", OnPlayerRegister, "d", playerid);
It would probably be possible to script a function for this in PAWN with the given functions but I'm sure this would be much better coded in C++. This would make threading much easier.
Also: It would be cool if mysql_store_result could store more than one result. It could work like SA:MP's native SQLite functions: Assigning a tagged variable to a query would automatically store the given result. This would make threading MUCH easier and eliminate the use for the store/free result natives.