[eluser]elaniobro[/eluser]
I believe that I am set up correctly but my foreach loop is not displaying distinct results only.
controller:
Code:
function index()
{
$data['page'] = 'thoughts';
$data['query'] = $this->db->order_by('id DESC')->get('thoughts');
$data['tag'] = $this->db->distinct('tag')->get('thoughts');
$this->load->view('header', $data);
$this->load->view('campaign');
$this->load->view('thoughts_view', $data);
$this->load->view('footer');
}
and the foreach loop in the view:
Code:
<ul>
Tags:<br />
<ul>
<?php foreach($tag->result() as $row):?>
<li><?= $row->tag?></li>
<?php endforeach;?>
</ul>
</ul>
Not getting any errors, so I assume the syntax is correct, but apparently my implementation of it is not.