12-17-2015, 03:10 AM
(This post was last modified: 12-17-2015, 03:27 AM by wolfgang1983.)
It did not work with the db select for some reason so just went with db get and where
PHP Code:
<?php
class Set_language {
public function __construct() {
$this->ci =& get_instance();
//$this->ci->config->set_item('language', $this->lang());
}
public function lang() {
$this->ci->db->where('code', $this->get_lang());
$query = $this->ci->db->get($this->ci->db->dbprefix . 'language');
$row = $query->row();
return $row->directory;
}
public function get_lang() {
$this->ci->db->where('item_name', 'admin_language');
$query = $this->ci->db->get($this->ci->db->dbprefix . 'setting');
$row = $query->row();
return $row->item_value;
}
}
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!