title: codeigniter and JSON
body: <p>Hello all i having a problem that it only get 1 value in my database and its my title and i want to show content and username from the same table to.</p>
  
  <p>here is my JSON kode</p>
  
  <pre><code>      &lt;script type="text/javascript"&gt;
      $.getJSON(
           'ajax/forumThreads', 
           function(data) {
               alert(data[0].overskrift);
               alert(data[0].indhold);
           }
       );
    &lt;/script&gt;
  </code></pre>
  
  <p>my controller</p>
  
  <pre><code>    &lt;?php
  class ajax extends Controller
  {
  
   function forumThreads() {
  
       $this-&gt;load-&gt;model('ajax_model');
       $data['forum_list'] = $this-&gt;ajax_model-&gt;forumList();
  
       if ($data['forum_list'] !== false) {
           echo json_encode($data['forum_list']);
       }
   }
  
  }
  </code></pre>
  
  <p>my model fle</p>
  
  <pre><code>    &lt;?php
  class ajax_model extends Model
  {
  
   function forumList()
   {
       $this-&gt;db-&gt;select('overskrift', 'indhold', 'brugernavn', 'dato');
       $this-&gt;db-&gt;order_by('id', 'desc');
    $this-&gt;db-&gt;limit(5);
       $forum_list = $this-&gt;db-&gt;get('forum_traad');
  
       if($forum_list-&gt;num_rows() &gt; 0)
       {
           return $forum_list-&gt;result_array();
       } else {
           return false;
       }
   }
  
  }
  </code></pre>