title: Display only last 5 records from database using Codeigniter 3
body: <p>I wanted to get recent records from database limit only to 5. I used the code below but not working. Maybe I missed something or the whole query is wrong. Please guide me. Thanks</p>
  
  <p>Model</p>
  
  <pre><code> public function get_comments ($id) {
    $this-&gt;db-&gt;select('*');
    $this-&gt;db-&gt;order_by('id', 'ASC');  
    $this-&gt;db-&gt;from('Item_comments');
    $this-&gt;db-&gt;limit('5');
    $this-&gt;db-&gt;where(array('checklist_item_id' =&gt; $id, 'status' =&gt; 1));
  
    $query = $this-&gt;db-&gt;get();
    return $query-&gt;result_array();
   }
  </code></pre>
  
  <blockquote>
    <p>Note: query works fine and get 5 records from db but I want to
    position the recent into the bottom. Thanks</p>
  </blockquote>