[eluser]8Lou[/eluser]
Hello folks,
whats wrong with my join?
the view returns me duplicate images from database, twice the same image
Code:
function getAlbumPhotos()
{
$this->db->select('album.id, album.alb_titulo, album.alb_evento, album.alb_status, files.fil_path, files.id');
$this->db->from('album', 'files');
$this->db->join('files', 'files.fil_album', $this->uri->segment(3));
$query = $this->db->get();
return $query->result();
}
<div id="gallery">
<?php if (isset($records)): foreach($records as $row): ?>
<div class="thumb">
<a href="<?php echo base_url(); ?>uploads/<?php echo $row->fil_path; ?>" rel="facebox">
<img src="<?php echo base_url(); ?>uploads/thumbnails/<?php echo $row->fil_path; ?>"/>
</a>
</div><div><p><?php echo anchor("album/imgdell/$row->id", "Deletar foto"); ?></p></div>
<?php endforeach; else: ?>
<div id="blank_gallery">Nenhuma foto adicionada ao álbum</div>
<?php endif; ?>
<p><?php echo anchor("album/dellall/$row->id", "Deletar todas fotos"); ?></p>
</div>
Thanks!