使用codeigniter从数据库中显示图像及其附带信息

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

You can do like this:

<?php foreach($dbInfo as $image): ?>
<ul class="thumbnails">
<li class="span3">
    <div class="thumbnail">
        <img src="<?php echo $image['full_path']; ?>"/>
        <h3><?php echo $image['image_name']; ?></h3>
        <p><?php echo $image['image_type']; ?></p>
        <p><?php echo $image['image_size']; ?></p>
        <p><?php echo $image['image_dimensions']; ?></p>
    </div>
</li>
<?php endforeach; ?>