Hello I got the this result
A PHP Error was encountered
Severity: Error
Message: Cannot use object of type CI_DB_mysqli_result as array
Filename: controllers/Threads.php
Line Number: 48
Backtrace:
This is my codes in Controller
// category
public function threadsview($slug) {
// get threads category
$data['item'] = $this->threads_model->getThreadsCategory($slug);
$data['title'] = $data['item']['catname'];
$data['desc'] = '';
$this->load->view('themes/default/header', $data);
$this->load->view('threads/threadsview', $data);
$this->load->view('themes/default/footer');
}
And the codes in my Model
//get threads categories by slug
public function getThreadsCategory($slug) {
$this->db->order_by('id','asc');
$this->db->where('slug',$slug);
$query = $this->db->get('threads_cat');
return $query;
}
The error is from this code
$data['title'] = $data['item']['catname'];
I hope someone can help me regarding on this..