[eluser]Référencement Google[/eluser]
Hi,
I am stopped with a problem.
I have 1 DB query that return 5 rows, that rows are the photo files.
My gallery has 1 big picture and then 4 thumbnails. I don't know how to make that working, need some help. Some code will help:
In the model, the query:
Code:
SELECT * FROM nip_photo LIMIT 5
Then, in the controller:
Code:
// The function _get_latestProfiles() retrieve the photos data from the DB
$data['latestpics'] = $this->_get_latestProfiles();
$this->load->view('gallery', $data);
Then the view:
Code:
<!-- HERE is my problem,
I would like from the query to get the first row as the big picture,
then loop in the foreach to get the other thumbnails that must be different from
the big picture -->
<img class="big_picture" src="here I want the big picture" />
<div class="thumbnails">
<?php foreach($latestpics as $pic): ?>
<img src="thumb-<?=$pic->photo_file?>" />
<?php endforeach ?>
</div>
Note that I simplified my original code.
I don't have problem printing thumnails on screen, this is working, I just don't know how to make things to get the first DB row as the big picture and the following result rows as thumbnails.
Some help ?