title: How to add an ORDER BY clause using CodeIgniter's Active Record methods?
body: <p>I have a very small script to get all records from a database table, the code is below.</p>
  <pre><code>$query = $this-&gt;db-&gt;get($this-&gt;table_name);
  return $query-&gt;result();
  </code></pre>
  <p>Using this syntax, how would I add a <code>ORDER BY 'name'</code> clause to my select query?</p>
  <p>I get errors every time I stick the order by bit on the end.</p>