Pulling data from SQL table in script

let me know when you have found a solution. Looking for a solution for custom queries too. maybe someone with more developementknowledge can help us reading the sourcecode of hiveext.dll. I even dont know where i can find the source of the dllfile
 
Seems to me the solution is to move to the Reality server, unless Pwnoz0rs servers gets this functionality. I did my 50K+ lines of C++ - NEVER AGAIN!! I hate managing memory manually it makes my brain hurtZ!
 
Cant find the sourcecode with Child:999 in reality. Maybe someone can Post the link and i try to insert It into lite dll
 
never heard of Arma2MySQL any of you? you can use that long side with the default hive to use mysql connections from and to your dayz game server...
 
arma2mysql is a plugin to use with arma2net to communicate with a mysql server. I didn't read much of this thread since it WAS 9 months old but here is my 2cents worth. I run Dayz 1.8.0.3 and use child:999 to read and write to the database for private skins for each player so you don't need anything extra. I am not 100% sure, but I think Dayz mod database access is using the arma2mysql library ... so adding it would be redundant.

EDIT:
Seeweeduk is correct, when I use pwnozors server locally for testing, there is no child:999 as it was removed for security. If you need to save/load data but not interact with the database direclty, you could use the @inidbi .. I used that on a wasteland server and could save vehicles, inventory, player states etc and respawn them at server restart. It is server side only, no client downloads required but it won't work on a linux server as it requires callext.
 
Last edited:
arma2mysql is a plugin to use with arma2net to communicate with a mysql server. I didn't read much of this thread since it WAS 9 months old but here is my 2cents worth. I run Dayz 1.8.0.3 and use child:999 to read and write to the database for private skins for each player so you don't need anything extra. I am not 100% sure, but I think Dayz mod database access is using the arma2mysql library ... so adding it would be redundant.

I believe its only when you aren't running with reality you won't have child 999. I don't use reality so I might take a look at that for some future stuff cheers soul. No idea about other mods as I run dayzmod.
 
@inidbi seems to be just a flatfile datastorage solution.
Arma2MySQl on the other hand is the full works and is capable of every mysql command known.

i prefer the last option any day, its being widely used by arma life servers.
 
correct. I used the @inidbi on my wasteland server and am working on implementing it in my Arma2 FFA server to keep permanent scores. Its definatly limited, but it does work easily and can be made to do the same as the sql database. I have considered using the inidbi to store data and an external php script to insert the data into the mysql database.
The main advantage of @inidbi is that it works on Linux servers which wouldn't be an issue for dayz admins. Its just another option that is easy to install and use, but I agree its not as versatile as a mysql.
 
Does anybody know whats wrong with this code?
Code:
_key = format["CHILD:101: select donor from donors where donor = '%1'",_playerID];
_result = _key call server_hiveReadWrite; 

_status    = _result select 0;

    if (_status == "CustomStreamStart") then {    //check if the stream coming from the hive was opened
        _val = _result select 1;                  // get the number of entries that will be coming in the stream
        diag_log format["MERG: Value of - _val : %1",_val];
    };
   
    _result = _key call server_hiveReadWrite;
    _tbl_plyr_id = _result select 0;            // will contain your actual value

I get this error: HiveExt: [Error] Error executing |CHILD:101: select donor from donors where donor = '110547078'|
 
You need to use Arma2NET for something like that.. Child:101 is for a specific use and cannot be used to read from other custom tables.

_key = format["select donor from donors where donor = '%1'",_playerID];
_result = _key call server_hiveReadWrite;
_status = _result select 0;

And server_hiveReadWrite would be this :

Code:
server_hiveReadWrite = {
    private["_key","_resultArray","_data"];
    _key = _this;
    _data = format["Arma2NETMySQLCommand ['%2',""%1""]",_key, DB_NAME];
    SQL_RESULT = "Arma2Net.Unmanaged" callExtension _data;
    _resultArray = call compile format ["%1",SQL_RESULT];
    _resultArray
};

I have DB_name as a global var as you see but that is how it works ;)
 
You need to use Arma2NET for something like that.. Child:101 is for a specific use and cannot be used to read from other custom tables.

_key = format["select donor from donors where donor = '%1'",_playerID];
_result = _key call server_hiveReadWrite;
_status = _result select 0;

And server_hiveReadWrite would be this :

Code:
server_hiveReadWrite = {
    private["_key","_resultArray","_data"];
    _key = _this;
    _data = format["Arma2NETMySQLCommand ['%2',""%1""]",_key, DB_NAME];
    SQL_RESULT = "Arma2Net.Unmanaged" callExtension _data;
    _resultArray = call compile format ["%1",SQL_RESULT];
    _resultArray
};

I have DB_name as a global var as you see but that is how it works ;)

Cant seem to get it to work. No errors but i made diag_log("MERG: " + str(_resultArray)); to test it but it doesn't write it in the log. Thanks anyways
 
Back
Top