title: Need to populate an array with query results and json_encode those results (within codeigniter)
body: <p>My query works fine and returns over 1000 rows. However when ran through the following foreach loop, only the first row of records is returned in JSON encode and is recognised as a string and not an array.</p>
  
  <p>Here is the loop:</p>
  
  <pre><code>foreach ($query-&gt;result_array() as $row){
      $row['Client_Desc'];
      $row['Parent_Entity_Name'];
      $row['Entity_Name'];
      $row['trackbacknumber'];
      $row['external_reference'];
      $row['effective_start_date_time'];
      $row['effective_end_date_time']."&lt;br /&gt;";
  }
  var_dump(json_encode($row, TRUE));
  </code></pre>
  
  <p>And the result which is returned is as follows:....</p>
  
  <pre><code>string '{"Client_Desc":"FGA-Italy","Parent_Entity_Name":"Fiat Italy","Entity_Name":"Fiat Italy     Dealer","trackbacknumber":"390236000471","external_reference":"0","effective_start_date_time":"04\/03    \/2013 10:13:57","effective_end_date_time":"01\/01\/3000 00:00:00"}' (length=255)
  </code></pre>
  
  <p>Am I using result_array correctly?</p>
  
  <p>Thanks for your time. All help is very much appreciated!</p>