title: How do you debug CodeIgniter applications?
body: <p>I followed steps in a tutorial to learn how to use Code Igniter to build a PHP/MySQL application and upon completion the application fails with no error.  I'm using TextMate rather than a full featured IDE.  </p>
  
  <p>How do most developers using Code Igniter debug their applications?  Is there something in the framework for bubbling errors and a stack trace into the browser session?  </p>
  
  <p>The specific problem I'd like to address now seems database related.  I configured my database, setup autoload.php, and created a controller and model for handling table data, and a view for presenting it.  From my accounts_model.php:</p>
  
  <pre><code> public function getData()  
   {
       //Query the data table for every record and row
       $query = $this-&gt;db-&gt;get('accounts');
  
       if ($query-&gt;num_rows() &gt; 0)
       {
           show_error('Database is empty!');
       }
       else
       {
           return $query-&gt;result();
       }
   }
  </code></pre>
  
  <p>When I run the application, I see "An Error was Encountered\nDatabase is empty!".  Since I know the database is not empty and configuration is correct, I need something from the framework to give me a hint whether it is connecting to the database or why the query is empty.</p>