In following code i has error in view, how can fix it?
My data in table is as:

CI_Controller:
$update = array('15'); // this is a example from my $_POST that are array.
if (is_array($update) && count($update) > 0) {
foreach($update as $val){
$data['query_hi'] = $this->db->get_where('hotel_image', array('relation' => $val))->row();
}
$this -> load -> view('admin/residence_update', $data);
}
View:
foreach($query_hi->images as $val){
echo $val;
}
Error:
A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: core/Loader.php(679) : eval()’d code
Line Number: 279
The problem is that it returns only one result for your query… and the array is overridden at each cycle. Try this: