title: how to connect database multiple server in codeigniter?
body: <p>i build project in my local server but file database save in another server. i try edit in config database.php like this</p>
  
  <pre><code>$active_group = 'default';
  $active_record = TRUE;
  
  $db['default']['hostname'] = 'localhost';
  $db['default']['username'] = '';
  $db['default']['password'] = '';
  $db['default']['database'] = '';
  $db['default']['dbdriver'] = 'mysql';
  $db['default']['dbprefix'] = '';
  $db['default']['pconnect'] = TRUE;
  $db['default']['db_debug'] = TRUE;
  $db['default']['cache_on'] = FALSE;
  $db['default']['cachedir'] = '';
  $db['default']['char_set'] = 'utf8';
  $db['default']['dbcollat'] = 'utf8_general_ci';
  $db['default']['swap_pre'] = '';
  $db['default']['autoinit'] = TRUE;
  $db['default']['stricton'] = FALSE;
  
  
  $db['database_two']['hostname'] = 'xxx.xxx.xx.xx';
  $db['database_two']['username'] = 'vtis';
  $db['database_two']['password'] = '';
  $db['database_two']['database'] = 'vtis';
  $db['database_two']['dbdriver'] = 'postgre';
  $db['database_two']['dbprefix'] = '';
  $db['database_two']['pconnect'] = TRUE;
  $db['database_two']['db_debug'] = TRUE;
  $db['database_two']['cache_on'] = FALSE;
  $db['database_two']['cachedir'] = '';
  $db['database_two']['char_set'] = 'utf8';
  $db['database_two']['dbcollat'] = 'utf8_general_ci';
  $db['database_two']['swap_pre'] = '';
  $db['database_two']['autoinit'] = TRUE;
  $db['database_two']['stricton'] = FALSE;
  $db['database_two']['port'] = 5432;
  </code></pre>
  
  <p>but i don't know next step after that. can you tell me step by step how to connect database in another server with codeigniter? </p>
  
  <p>munit_list.php</p>
  
  <pre><code>*/
  class Munit_list extends CI_Model
  {
  
      private $tbl_unit_list = 'unit_list';
      function __construct()
      {
          parent::__construct();
          $CI=&amp;get_instance();
          $CI-&gt;database_two = $this-&gt;load-&gt;database('database_two', TRUE);
          $this-&gt;database_two =&amp; $CI-&gt;database_two; 
      }
  
      function get_all_unit_list()
      {
          $this-&gt;database_two-&gt;order_by('unit_id','desc');
          $data = $this-&gt;database_two-&gt;get($this-&gt;tbl_unit_list);
          return $data-&gt;result();
      }
  
  }
  </code></pre>
  
  <p>i try model like this but its not working</p>