I want to select all the rows that emp id's are match to my session userdata (emp_id). Here's my code. I get so many errors and no row has been selected. Someone help me please. Thanks
Model:
public function get_save_samp($emp_id) {
$query = $this->db->get_where('tblsavesample', array('emp_id' =>
$emp_id));
return $query->row_array();
}
Controller:
public function show() {
$emp_id = $this->session->userdata('emp_id');
$data['save'] = $this->user_model->get_save_samp($emp_id);
$this->load->view('show',$data);
}
Views:
<?php foreach ($save as $row) { ?>
<td style="width: " ><?php echo $row->emp_id ?></td>
<td style="width: " ><?php echo $row->emp_code?></td>
<td style="width: " ><?php echo $row->emp_name ?></td>
<?php }>