title: Database query in CodeIgniter
body: <p>I have a table named "news" containing the following details:
  id, title, slug, text</p>
  
  <p>As such, I used the following code to retrieve the whole "news" table from my database.</p>
  
  <pre><code>public function get_news($slug = FALSE)
          {
              if ($slug === FALSE)
              {
                  $query = $this-&gt;db-&gt;get('news');
                  return $query-&gt;result_array();
              }
  
              $query = $this-&gt;db-&gt;get_where('news', array('slug' =&gt; $slug));
              return $query-&gt;row_array();
          }
  </code></pre>
  
  <p>Displaying the result</p>
  
  <pre><code>&lt;?php foreach ($news as $news_item): ?&gt;
  
                  &lt;h3&gt;&lt;?php echo $news_item['title']; ?&gt;&lt;/h3&gt;
                  &lt;div class="main"&gt;
                          &lt;?php echo $news_item['text']; ?&gt;
                  &lt;/div&gt;
                  &lt;p&gt;&lt;a href="&lt;?php echo site_url('news/'.$news_item['slug']); ?&gt;"&gt;View article&lt;/a&gt;&lt;/p&gt;
  
          &lt;?php endforeach; ?&gt;
  </code></pre>
  
  <p>How should I go about to change the code in order to get the query result of "select title, text from news;"?</p>