title: Define constants from mysql database in PHP Codeigniter config file
body: <p>Hi I am trying to defining constants from mysql database, but could not load  the database in codeigniter config file. </p>
  
  <pre><code>$db =$CI-&gt;load-&gt;database();
  $query = $db-&gt;get('constants');
  foreach( $query-&gt;result() as $row ){ define($row-&gt;title, $row-&gt;value); }
  </code></pre>
  
  <p>But it is throwing me an error "Undefined variable: CI"</p>