now my joined table returns the first posts row, i want it to have the last row for each topic
this is my code now
$this->db->select('*');
      ->where('disccategory_id', $cat);
       ->from('discussiontopics as topics');
       ->join('discussionposts as posts', 'posts.topic_id = topics.id', 'left');
       ->order_by('posts.id', 'desc');
       ->group_by('topics.id');
maybe i can only do it with a select inside the join? but not sure how to do that with Codeigniter's Active Record
 
     
     
    