title: Codeigniter- How to use database functions while extending native libraries?
body: <p>I want to access database functions in extending libraries.</p>
  
  <pre><code>class My_Router extends CI_Router {
  
      public function __construct()
      {
          parent::__construct();
      }
  
      function _set_routing()
      {
          .....
          ....
          $query=$this-&gt;db-&gt;get('custome_routes');
          $custom_routes=$query-&gt;result_array();
          ....
  
      }
   }
  </code></pre>
  
  <p>I tried below also</p>
  
  <pre><code> $CI =&amp; get_instance();
      $query=$CI-&gt;db-&gt;get('custome_routes');
      $custom_routes=$query-&gt;result_array();
  </code></pre>
  
  <p>But it doesn't work. </p>
  
  <p>Help me....</p>
  
  <p><em><strong>Thanks in advance,
  Logan</em></strong></p>