title: Codeigniter get existing database connection info
body: <p>I want to execute on my exisitng codeingiter project a background  script.</p>
  
  <p>The script will use the very same username, password, database and database host from my <strong>Codeingiter</strong> application. This info I want to be passed as command parameters to my script.</p>
  
  <p>Let me show an example (supposing we are in a model):</p>
  
  <pre><code>public function callBackgroundScript()
  {
     $db_host='';
     $db_name='';
     $db_user='';
     $db_password='';
     exec("php somescript.php $db_host $db_name $db_user $db_password &gt; /dev/null &amp;");
  }
  </code></pre>
  
  <p>On the example above how I will set with the existing connection <code>($this-&gt;db)</code>theese values?</p>