@
kilishan
The model class have two bugs.
find($id) and find_all() need a small fix
PHP Code:
public function find_all()
{
$query = $this->db->get($this->table_name);
$rows = $this->temp_return_type == 'array' ?
$query->result_array() :
$query->result($this->temp_return_type);
$this->temp_return_type = $this->return_type;
return $rows;
}
PHP Code:
public function find($id)
{
$query = $this->db->where($this->primary_key, $id)
->get($this->table_name);
$row = $this->temp_return_type == 'array' ?
$query->row_array() :
$query->row(0, $this->temp_return_type);
$this->temp_return_type = $this->return_type;
return $row;
}
I added "db". Without the "db" the code do not return rows