Welcome Guest, Not a member yet? Register   Sign In
Query result error undefined variable
#5

Excellent stuff i could see the problem after you explained it...


The model should look like this:

PHP Code:
public function get($id null$order_by null)
    {
        
        if(
is_numeric($id)){
            
$this->db->where($this->_primary_key$id);
            
$q $this->db->get($this->_table);
            return 
$q->row_array();
        }

        if(
is_array($id)){
            foreach (
$id as $_key => $_value){
                
$this->db->where($_key$_value);

            }
            
        }
        
$q $this->db->get($this->_table);
        return 
$q->result_array();
        
    } 
Reply


Messages In This Thread
Query result error undefined variable - by skoobi - 08-23-2015, 02:29 AM
RE: Query result error undefined variable - by skoobi - 08-23-2015, 09:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB