title: SQLite3, PDO, Active Record, and CodeIgniter
body: <p>I'm having problems getting CodeIgniter to work with SQLite3. </p>
  
  <p>Here are my database.php configs: </p>
  
  <pre><code>$active_group = 'sqlite';
  $query_builder = TRUE;
  
  /* SQLite3 config for PDO */
  
  $db['sqlite'] = array (
      'dsn' =&gt; 'sqlite:' .FCPATH.'virtTour_original.sqlite',
      'hostname' =&gt; '',
      'username' =&gt; '',
      'password' =&gt; '',
      'dbdriver' =&gt; 'pdo',
      'dbprefix' =&gt; '',
      'pconnect' =&gt; FALSE,
      'db_debug' =&gt; TRUE,
      'cache_on' =&gt; FALSE,
      'cachedir' =&gt; '',
      'char_set' =&gt; 'utf8',
      'dbcollat' =&gt; 'utf8_general_ci',
      'swap_pre' =&gt; '',
      'autoinit' =&gt; TRUE,
      'stricton' =&gt; FALSE,
      'failover' =&gt; array()
  );
  </code></pre>
  
  <p>Here's the controller I'm testing with:</p>
  
  <pre><code>&lt;?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  class Main extends CI_Controller {
  
      function __construct()
      {
          parent::__construct();
          $this-&gt;load-&gt;database(); 
      }
  
      public function index()
      { 
          $query = $this-&gt;db-&gt;get('tblBuildings');
          foreach ($query-&gt;result_array() as $row)
          {
              echo $row;
          }
      }
  }
  
  /* End of file main.php */
  /* Location: ./application/controllers/main.php */
  </code></pre>
  
  <p>This is what happens when I view main:</p>
  
  <blockquote>
    <p>ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray</p>
  </blockquote>
  
  <p>There are 19 rows in the table so I know it's getting something from this (as it echos <code>Array</code> 19 times). But other calls do not seem to work. (i.e) <code>echo $row['id'];</code></p>
  
  <p>A <code>var_dump</code> on <code>$query</code> produces:</p>
  
  <blockquote>
    <p>object(CI_DB_pdo_result)#16 (8) { ["conn_id"]=> object(PDO)#14 (0) { }
    ["result_id"]=> object(PDOStatement)#15 (1) { ["queryString"]=>
    string(28) "SELECT * FROM "tblBuildings"" } ["result_array"]=>
    array(0) { } ["result_object"]=> array(0) { }
    ["custom_result_object"]=> array(0) { } ["current_row"]=> int(0)
    ["num_rows"]=> NULL ["row_data"]=> NULL }</p>
  </blockquote>
  
  <p>There is data in the table, but it doesn't show here...</p>