[eluser]CroNiX[/eluser]
Lots of ways, actually. You can extend the Controller with MY_Controller and put it there. You could create a library. You could also put it in a helper, but not the way you are doing it. A helper is a regular php function, so it doesn't know anything about CI ($this) unless you bring the CI superglobal into it, like:
Code:
function get_setting($setting)
{
$CI =& get_instance(); //now access CI using $CI instead of $this
$query = $CI->db->where('setting_name',$setting)->get('settings')->row();
return $query->value;
}