09-01-2017, 12:23 PM
Usually these sorts of functions go in usersc/custom_functions.php
I think the function would look more like this...
function getConfig ($search)
{
$config = $db->query("select options from config where setting = ?,array($search));
$back = $config->first();
return $back;
}
Then you would call it by saying
$options = getConfig('myoption');
I'm guessing your config table is setup with basically 3 columns..
id(auto incrementing)
options (the actual options in varchar)
setting (whatever you call the options in varchar)
I think the function would look more like this...
function getConfig ($search)
{
$config = $db->query("select options from config where setting = ?,array($search));
$back = $config->first();
return $back;
}
Then you would call it by saying
$options = getConfig('myoption');
I'm guessing your config table is setup with basically 3 columns..
id(auto incrementing)
options (the actual options in varchar)
setting (whatever you call the options in varchar)