• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] mysql_query to tquery inline
#2
Your syntax might be incorrect. I think you can't format the string in that function, you need to format it earlier.



Check this:



Code:
new query[1024];

mysql_format(ourConnection, query, sizeof query, "SELECT COUNT(*) FROM vehicles WHERE VehicleOwnerDBID = %d", PlayerInfo[playerid][pDBID]);

inline LoadData() {

new rows;

? ? ? ? if(cache_get_row_count(rows)) {

? ? ? ? ? ? cache_get_value_index_int(0, 0, count);

? ? ? ? }

@return 1;

}

MySQL_TQueryInline(ourConnection, using inline LoadData, query);





Also note tquery is not happening instantly! If you need the data immediately to be handled by a function use non-threaded queries.
Check out Desolation Roleplay, where zombie AI and scavenging is bothered by player bandits!


  Reply


Messages In This Thread
mysql_query to tquery inline - by Zow - 2021-04-23, 05:07 PM
RE: mysql_query to tquery inline - by Awide - 2021-04-24, 08:46 AM

Forum Jump: