I need to get the last group of my data. I already did order_by
but still it did not produce my expected output
For visual reference here is what my table and its value are
So I need to get the last group of data, where in the Capital of Australias
is repeated in id number 5
.
Here is my Model and my query.
public function view_results($id){
$this->db->select('*');
$this->db->from('results');
$this->db->where('post_id', $id);
$this->db->order_by('date_answered', 'DESC');
$this->db->group_by('question');
$query = $this->db->get();
return $result = $query->result_array();
}