title: Empty database output in CI
body: <p>I'm building a simple app and trying to test DB result output. But unfortunately all I'm getting is an array of size 0. Here's the controller code excerpt:</p>
  
  <pre><code>$data['query'] = $this-&gt;db-&gt;query('SELECT role_id, role_privilege FROM role');
  $this-&gt;load-&gt;view('welcome_message', $data);
  </code></pre>
  
  <p>And a view code excerpt:</p>
  
  <pre><code>&lt;?php
          echo count($query-&gt;result_array())."&lt;br/&gt;";
          foreach ($query-&gt;result() as $row){
              echo $row-&gt;role_id . '&lt;br/&gt;';
              echo $row-&gt;role_privilege . '&lt;br/&gt;';
          }
          echo 'Total result '.$query-&gt;num_rows();
      ?&gt;
  </code></pre>
  
  <p>And what I get is next:</p>
  
  <pre><code>0
  Total result
  </code></pre>
  
  <p>Running query from a command line gives a 2 rowed output. Can someone point out what i'm missing?</p>
  
  <p><strong>EDITED:</strong>
  <br/>This issue is also discussed <a href="http://codeigniter.com/forums/viewthread/154561/" rel="nofollow noreferrer">here</a> .</p>
  
  <p><strong>EDITED:</strong><br/>
  Maybe some platform specific stuff (I really doubt that)? I'm running LAMP (php 5.3.2, mysql 5.1.37, apache 2.2.15).</p>
  
  <p><strong>EDITED:</strong><br/>
  This prints out a "Array ( )" string. My DB is 100% filled. I can say that for sure, because I did </p>
  
  <pre><code>INSERT INTO role(role_privilege) VALUES ('ROLE_MODERATOR');
  INSERT INTO role(role_privilege) VALUES ('ROLE_USER');
  </code></pre>
  
  <p>and then checked it through a command line.</p>
  
  <p><strong>EDITED:</strong>
  <br/>After I put this into my controller:</p>
  
  <pre><code>echo $this-&gt;db-&gt;last_query(); exit;
  </code></pre>
  
  <p>I get next output:</p>
  
  <pre><code>SELECT role_id, role_privilege FROM role
  </code></pre>
  
  <p>And that's exact sql query that I needed. Unfortunately results are o sized array.</p>