title: Why do i get Message: Illegal offset type and what does it mean
body: <p>When using CodeIgnator I get the followeing error when i try to use my database:</p>
  
  <p>A PHP Error was encountered</p>
  
  <p>Severity: Warning</p>
  
  <p>Message: Illegal offset type</p>
  
  <p>Filename: models/flight_model.php</p>
  
  <p>Line Number: 12</p>
  
  <p>The code that produces this errors :</p>
  
  <pre><code>     $query = $this-&gt;db-&gt;query('SELECT Date, ID, Destination FROM flight');
  
         $flights= array();
           foreach ($query-&gt;result() as $row)
            {
                  $flights[$row] = array('flight_id' =&gt; $row-&gt;ID, 'Date'=&gt;$row-&gt;Date, 'Destination' =&gt; $row-&gt;Destination);
            } 
  </code></pre>
  
  <p>I don't understand what the problem is with the code :S </p>
  
  <p>All answers are appriciated</p>