[eluser]mikeyhell[/eluser]
Hi All, I'm stuck on a problem and was looking for some insight. I know the solution is simple, but I can't seem to get this working. I'm returning the following to my view:
Code:
function get_all()
{
$this->db->select_max('postdate');
//$this->db->distinct('postdate');
$this->db->group_by('postdate', 'desc');
$query = $this->db->get('events');
if( $query->num_rows() > 0 ):
$result = $query->result_array();
foreach($result as $date ):
$select_date = $date['postdate'];
$this->db->where('postdate', $select_date);
$query = $this->db->get('events');
$return= $query->result();
endforeach;
return $return;
else:
return false;
endif;
}
But I am trying to get headings i.e.
====================
Monday June 10th
entry 1
entry 2
entry 3
Tuesday June 11th
entry 1
entry 2
entry 3
====================
Thanks