I want to filter data according to login user.before i filter the data by Login user it was work fine. now it shows an error
Severity: 4096
Message: Object of class Floor_model could not be converted to string
Filename: models/Book_model.php
Line Number: 14
A PHP Error was encountered
Severity: Notice
Message: Object of class Floor_model to string conversion
Filename: models/Book_model.php
Line Number: 14
View
<?php foreach($post as $post){?>
<tr>
<td><?php echo $post->id ; echo ' ';?></td>
<td><?php echo $post->title ; echo ' ';?></td>
</tr>
<?php } ?>
Model
function get_book(){
$id = $this->session->$this->session->userdata['logged_in']['id'];// getting id
$this->db->select("book.id,book.title");
$this->db->where('user_id', $id);//
$this->db->from('book');
$query = $this->db->get();
return $query->result();
}
Controller
public function index(){
$data['post'] = $this->floor_model->get_book();
$this->load->view('user_include/header');
$this->load->view('plan/floor',$data);
}