Sign in to follow this  
dekela

Pull info from database column

3 posts in this topic

exile_server_system_database_query_selectSingle pulls all the information from a database 'row'

is there another query that pulls all the information from a database 'column'

thanks

Share this post


Link to post
Share on other sites

Just an example:

_stock = "getStock" call ExileServer_system_database_query_selectFull;
[getStock]
SQL1_1 = SELECT item, stock FROM trading
Number of Inputs = 0
OUTPUT = 1-STRING,2

 

Edited by WURSTKETTE

Share this post


Link to post
Share on other sites

thank you very much. what i have done is this:

_econID = 1;
_econItemName = format ["getEconItem:%1",_econID] call ExileServer_system_database_query_selectFull;
[getEconItem]
SQL1_1 = SELECT econItem FROM econPrice WHERE econID = ?
Number of Inputs = 1
SQL1_INPUTS = 1

the actual script is

if (!isServer && hasInterface) exitWith {};
private["_getEconData","_econID","_econItemName"];
_econID = 1;
_econItemName = format ["getEconItem:%1",_econID] call ExileServer_system_database_query_selectFull;
{
_getEconData = format ["getEconData:%1", _x] call ExileServer_system_database_query_selectSingle;
missionNamespace setVariable [_x,_getEconData];
publicVariable _x;
} foreach [_econItemName];

using this method the foreach array is formatted like [[Exile_Weapon_CZ550],[Exile_Weapon_DMR]]

is there another way to call it or a way to change it so it formats like ["Exile_Weapon_CZ550","Exile_Weapon_DMR"]

 

Edited by dekela

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.