Welcome Guest, Not a member yet? Register   Sign In
[Solved] Not getting column from database correct?
#2

(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!
Reply


Messages In This Thread
RE: Not getting column from database correct? - by wolfgang1983 - 12-17-2015, 03:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB