Ok so im uploading images to a folder on my server, and then trying to re-display them with their information.
This is the function in my model that i am using to pull the info:
public function pull_all(){
$this->db->select('file_name, file_type, full_path, image_type');
$query = $this->db->get('img');
$dbInfo = $query->result_array();
return $dbInfo;
}
The controller implements the function like so:
function show_all(){
$this->load->model('image_work');
$data = array('dbInfo' => $this->image_work->pull_all());
$data['title'] = "Uploads";
$this->load->view('templates/header', $data);
$this->load->view('show_all',$data);
$this->load->view('templates/footer', $data);
}
The problem iv been having is in the view. I want each image to be shown with its info in this format:
<ul class="thumbnails">
<li class="span3">
<div class="thumbnail">
<img src="$location_stored_in_database"/>
<h3>$image_name</h3>
<p>$image_type</p>
<p>$image_size</p>
<p>$image_dimensions</p>
</div>
</li>
Iv tried many different ways to do it for example nested foreach statements, but I just cant seem to get it right. Any help would be appreciated.
thanks