title: Illegal string offset codeigniter
body: <p>Hi been trying to retrieve records from my database, but I keep getting this error "Severity: Warning Message: Illegal string offset " in several fields.</p>
  
  <p>Here's my controller view_logs.php</p>
  
  <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  class View_Logs extends CI_Controller {
  
  function View_Logs()
   {
     parent::__construct();
   }  
  
  function Logs(){
      $id = $this-&gt;uri-&gt;segment(3);
  
      $this-&gt;load-&gt;model('log_listmodel');
      $this-&gt;log_listmodel-&gt;log_list_get($id);    
  }
  }
  ?&gt;
  </code></pre>
  
  <p>Here's my Model log_listmodel.php</p>
  
  <pre><code>&lt;?php
  class Log_Listmodel extends CI_Model{
  
      function Log_Listmodel()
      {
        parent::__construct();
      }
  
      function log_list_get($id){
      $query = $this-&gt;db-&gt;get_where('test_request_log', array('test_request_id' =&gt; $id));
      //return $query-&gt;result();
      $results=$query-&gt;result_array();
  
  
      $data['query']=$results[0];
      $this-&gt;load-&gt;view('logs_list_view',$data);
      }
  }
  ?&gt;
  </code></pre>
  
  <p>Here's my view page log_list_view.php</p>
  
  <pre><code>&lt;table class="list_header" bgcolor="#ffffff" border="0" width="1020px" cellpadding="4px"&gt;
  
              &lt;?php foreach($query as $row): ?&gt;
              &lt;tr&gt; 
                  &lt;td&gt;&lt;b&gt;Updated&lt;/b&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $row['id'];?&gt;.&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $row['new_testing_reason'];?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $row['new_applicant_name'];?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $row['new_authorizer_name'];?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $row['new_received_by'];?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $row['new_test_required'];?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $row['new_laboratory_number'];?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $row['log_date'];?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $row['who'];?&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;?php endforeach; ?&gt;
          &lt;/table&gt;
  </code></pre>