title: Codeigniter establish database outside of public_html
body: <p>I am using Codeigniter as a php framework</p>
  
  <p>I need to write a script for a cron job outside of public_html that will modify a database, however I am not sure how to create a database instance where I can run queries and fetch the results</p>
  
  <p>I tried looking for what requires I need and what classes to call, however I couldn't figure it out</p>
  
  <p>Example: </p>
  
  <p>you normally have to write</p>
  
  <pre><code> $this-&gt;db-&gt;query("query");
  </code></pre>
  
  <p>however I need to run a query outside the scope of Codeigniter, outside the public_html folder. I need something like</p>
  
  <pre><code>require(database)
  require(database_configs)
  $DB = new $DB(configs)
  $DB-&gt;query("query")
  </code></pre>