• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Join with 2 tables, foreach problem?

Hello folks,

whats wrong with my join? the view returns me duplicate images from database, twice the same image
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">
&lt;?php if (isset($records)): foreach($records as $row): ?&gt;
  <div class="thumb">
   <a href="&lt;?php echo base_url(); ?&gt;uploads/&lt;?php echo $row-&gt;fil_path; ?&gt;" rel="facebox">
    <img src="&lt;?php echo base_url(); ?&gt;uploads/thumbnails/&lt;?php echo $row-&gt;fil_path; ?&gt;"/>
  </div><div><p>&lt;?php echo anchor("album/imgdell/$row->id", "Deletar foto"); ?&gt;</p></div>
&lt;?php endforeach; else: ?&gt;
  <div id="blank_gallery">Nenhuma foto adicionada ao √°lbum</div>
&lt;?php endif; ?&gt;
<p>&lt;?php echo anchor("album/dellall/$row->id", "Deletar todas fotos"); ?&gt;</p>


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme ¬© 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.