title: Codeigniter won't display errors on database write operations
body: <p>I have debugged a few errors that were the result of something like misspelling a database field name or something like that. CodeIgniter seems to load a blank page if there is an error in your query and you're trying to do a database write operation. How can I get it to tell me that there is something wrong with the query instead of displaying a blank page? It would help a lot when debugging these kind of problems cause it takes a while sometimes to figure out that the query is messed up. </p>
  
  <p>I added this to the error reporting portion of index.php to see if it may help but it still gives me a blank page:</p>
  
  <pre><code>if (defined('ENVIRONMENT'))
  {
      switch (ENVIRONMENT)
      {
          case 'development':
              error_reporting(E_ALL ^ E_DEPRECATED);
              ini_set('display_errors', 1);
          break;
  
          case 'testing':
          case 'production':
              error_reporting(0);
          break;
  
          default:
              exit('The application environment is not set correctly.');
      }
  }
  </code></pre>