and to me it seems your issue is a different one ...
you need to execute the server_hive_readwrite on the SERVER, not on the client.
IF the condition for the db query is triggered on the clientside, you need something like this:
What i do for my R3F object saving is:
a) have a function on the server that writes to the db
b) have a PublicVariable EH on the Server, that calls that function
c) publish the PublicVariable to the server from the client if a save is needed.
examples (you will need to adjust! and understand em ...)
in publicEH_server.sqf i added:
Code:
// SARGE event handler to save relocated buildings
["SAR_savebuilding", { (_this select 1) spawn SAR_save2hive; } ] call registerServerRpc;
in server_functions i reference the sqf file that holds the db writing code:
Code:
SAR_save2hive = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\SAR_save2hive.sqf";
in my clientfiles there's a file that gets called based on the addaction of a player selecting to save an object (the object_ID is passed to it):
Code:
SAR_savebuilding = _this select 0;
publicVariableServer "SAR_savebuilding";
IF your logic should only run on the server, add a
Code:
if(!isServer) exitWith {};
at the top of your code, and make sure your code is called within a server environment.
If that code is activated by a trigger (which i assume), you need to go the way that i described above, with PV'ing a variable that the server reacts upon. (reason being is that the trigger activation happens on the clientside)
Getting the value back to your client function is the next challenge ...
I would consider to define and create the trigger on the serverside, write a function to identify which player activated it, run the sql query, compare, and RE the messages that you want to display back to the client.
Sarge