title: Codeigniter change database config at runtime
body: <p>Can I change the database config per method in a controller?</p>
  
  <pre><code>$db['default']['db_debug'] = TRUE;
  </code></pre>
  
  <p>The default is <code>TRUE</code>, while I need to make it false in a certain method to catch the error and do something else (for example show 404 page).</p>
  
  <p>When I tried <code>$this-&gt;config-&gt;load('database')</code> it fails.</p>
  
  <p>Another question :</p>
  
  <p>Can I check an incorrect query and catch it to some variables rather than displaying it to users other than setting the <code>db_debug</code> config to <code>FALSE</code>?</p>