title: newbie problems with codeigniter
body: <p>i'm trying to learn codeigniter (following a book) but don't understand why the web page comes out empty. </p>
  
  <p>my controller is</p>
  
  <pre><code>class Welcome extends Controller {
  
      function Welcome()
      {
          parent::Controller();
      }
  
      function index()
      { 
          $data['title'] = "Welcome to Claudia's Kids";
          $data['navlist'] = $this-&gt;MCats-&gt;getCategoriesNav();
          $data['mainf'] = $this-&gt;MProducts-&gt;getMainFeature();
          $skip = $data['mainf']['id'];
          $data['sidef'] = $this-&gt;MProducts-&gt;getRandomProducts(3, $skip);
          $data['main'] = "home";     
          $this-&gt;load-&gt;vars($data);
          $this-&gt;load-&gt;view('template');
      }
  </code></pre>
  
  <p>the view is:</p>
  
  <pre><code>&lt;--doctype declaration etc etc.. --&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id="wrapper"&gt;
          &lt;div id="header"&gt;
              &lt;?php $this-&gt;load-&gt;view('header');?&gt;
          &lt;/div&gt;
  
          &lt;div id='nav'&gt;
              &lt;?php $this-&gt;load-&gt;view('navigation');?&gt;
          &lt;/div&gt;
  
          &lt;div id="main"&gt;
              &lt;?php $this-&gt;load-&gt;view($main);?&gt;
          &lt;/div&gt;
  
          &lt;div id="footer"&gt;
              &lt;?php $this-&gt;load-&gt;view('footer');?&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Now I know the model is passing back the right variables, but the page appears completely blank. I would expect at least to see an error, or the basic html structure, but the page is just empty. Moreover, the controller doesn't work even if I modify it as follows:</p>
  
  <pre><code>function index()
  { 
      echo "hello.";
  }
  </code></pre>
  
  <p>What am I doing wrong?
  Everything was working until I made some changes to the model - but even if I delete all those new changes, the page is still blank.. i'm really confused!</p>
  
  <p>thanks,
  P.</p>
  
  <hr>
  
  <p>I've isolated the function that gives me problems. 
  here it is:</p>
  
  <pre><code>function getMainFeature()
  {
      $data = array();
      $this-&gt;db-&gt;select("id, name, shortdesc, image");
      $this-&gt;db-&gt;where("featured", "true");
      $this-&gt;db-&gt;where("status", "active");
      $this-&gt;db-&gt;orderby("rand()");
      $this-&gt;db-&gt;limit(1);
      $Q = $this-&gt;db-&gt;get("products");
      if ($Q-&gt;num_rows() &gt; 0)
      {
          foreach($Q-&gt;result_arry() as $row)
          {
              $data = array(
                  "id" =&gt; $row['id'],
                  "name" =&gt; $row['name'],
                  "shortdesc" =&gt; $row['shortdesc'],
                  "image" =&gt; $row['image'] 
                  );
          }
      }
      $Q-&gt;free_result();
      return $data;
  }
  </code></pre>
  
  <p>I'm quite convinced there must be a syntax error somewhere - but still don't understand why it doesn't show any error, even if I've set up error_reporting E_ALL in the index function.. </p>