title: In CodeIgniter, how do I retrieve a sql query and order it by either ascending or descending order at the same time of query retrieval?
body: <pre><code>function index() {
      $info['title'] = 'Browser Title';
      $info['heading'] = 'Blog Heading';
  
      $info['query'] = $this-&gt;db-&gt;get('entries');
      $info['query'] = $this-&gt;db-&gt;order_by('id', 'asc');
  
      $this-&gt;load-&gt;view('blog_view', $info);
  }
  </code></pre>
  
  <p>I'm creating a mini blog app from a tutorial and wanted to add in the option of displaying blog entries in order of ascending or descending by id. The code above gives me an error but I pasted it up here hoping someone would be able to show me the correct way to do it. I've consulted the CI user manual but couldn't find any specific examples of what I"m looking for, which makes it somewhat confusing for a newbie like me.</p>