[eluser]hengsopheak[/eluser]
[quote author="hengsopheak" date="1400652992"]Dear Team Please help me!!!
I have many errors on this below code Call to a member function result() on a non-object in Codeigniter
Please help me
public function get($id = NULL, $single = FALSE) {
if ($id != NULL) {
$filter = $this->_primary_filter;
$id = $filter($id);
$this->db->where($this->_primary_key, $id);
$method = 'row';
} elseif ($single == TRUE) {
$method = 'row';
}
else{
$method='result';
}
if(!count($this->db->ar_orderby)){
$this->db->order_by($this->_order_by);
}
return $this->db->get($this->_table_name)->$method();
//return ($result instanceof CI_DB_mysql_result) ? $result->result() : false;
}[/quote]