title: Codeigniter returning 500 internal server error instead of error message when encountering database errors
body: <p>Just started working with CodeIgniter this week and am encountering a weird issue that has me stumped. Whenever there are any database related errors encountered in my application I just get a 500 internal server error page. I get PHP errors for everything else, the only errors I have noticed that I get this behavior on are database related.</p>
  
  <p>Two examples of this behavior:</p>
  
  <ol>
  <li>I noticed this first when tried to query a database using a string for criteria to evaluate an integer field</li>
  <li>Noticed this when I tried to create a database object using a reference to a database that hadn't been defined yet in <code>database.php</code>.</li>
  </ol>
  
  <p>I have CodeIgniter running an IIS server and I am using a SQL Server for the database. I can get the application to access the database, it's just when there are errors I can't get an error message, just a 500 page.</p>
  
  <p>Here are the things I've verified so far:</p>
  
  <ol>
  <li><code>db_debug</code> is set to <code>TRUE</code> in <code>database.php</code>.</li>
  <li>In <code>index.php</code> the environment is set to development.</li>
  <li>In <code>php.ini</code> <code>display_errors</code> is set to <code>On</code>.</li>
  </ol>
  
  <p>Any help would be greatly appreciated, not sure what else to check.</p>