title: CodeIgniter No rows returned from get()
body: <p>I've been messing with this for a few hours now.  It's got to be something dumb, but I'm just not seeing it.  Why does my db->get() not return any rows?  This is my first attempt at an MVC framework.  I've installed apache2, mysql, php5, and codeigniter in Ubuntu.  For some reason, I just can't seem to get the model to access the data in the database.</p>
  
  <pre><code># cat config/database.php 
  &lt;?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  $active_group = 'default';
  $active_record = TRUE;
  
  $db['default']['hostname'] = '127.0.0.1';
  $db['default']['username'] = 'webuser';
  $db['default']['password'] = 'webuser';
  $db['default']['database'] = 'product';
  $db['default']['dbdriver'] = 'mysql';
  $db['default']['dbprefix'] = '';
  $db['default']['pconnect'] = TRUE;
  $db['default']['db_debug'] = FALSE;
  $db['default']['cache_on'] = FALSE;
  $db['default']['cachedir'] = '';
  $db['default']['char_set'] = 'utf8';
  $db['default']['dbcollat'] = 'utf8_general_ci';
  $db['default']['swap_pre'] = '';
  $db['default']['autoinit'] = TRUE;
  $db['default']['stricton'] = FALSE;
  
  # cat models/productmodel.php 
  &lt;?php
      class Productmodel extends CI_Model {
  
              public function __construct() {
                      parent::__construct();
                      $this-&gt;load-&gt;database();
              }
  
              public function ListData() {
  
                      $query = $this-&gt;db-&gt;get("Fruit");
  
                      if ($query-&gt;num_rows() &gt; 0) {
                              foreach ( $query-&gt;result() as $row ) {
                                      echo "VALUE: &lt;BR&gt;\n";
                              }
                      } else {
                              $string = $this-&gt;db-&gt;last_query();
                              echo "$string &lt;BR&gt;\n";
                      }
  
                      return $query-&gt;result();
              }
      }
  ?&gt;
  
  # cat controllers/productcontroller.php 
  &lt;?php
      class Productcontroller extends CI_Controller {
              public function index() {
                      $this-&gt;load-&gt;model('productmodel');
  
                      $data['query'] = $this-&gt;productmodel-&gt;ListData();
  
                      $data['title'] = 'MVC Test';
                      $data['heading'] = 'Data From product.Fruit';
                      $this-&gt;load-&gt;view('content', $data);
              }
      }
  ?&gt;
  
  # cat views/content.php 
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;&lt;?php echo $title;?&gt;&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;h1&gt;&lt;?php echo $heading;?&gt;&lt;/h1&gt;
      &lt;?php foreach ($query AS $value) {echo "Value: $value &lt;BR&gt;\n"; } ?&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  
  # echo "SELECT * FROM product.Fruit" | mysql -h 127.0.0.1 -u webuser --password=webuser
  name      color   size
  Apple      Red     1
  Orange     Orange  1
  Watermelon Green   3
  Grape      Green   0
  Cherry     Red     0
  HoneyDew   Green   2
  </code></pre>