Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- protected $active_group;
- protected $db2;
- public function __construct() {
- parent::__construct();
- $this->connect();
- }
- $this->db->close();
- }
- public function connect($active_group = 'default'){
- $this->active_group = $active_group;
- $db = $this->load->database($active_group, TRUE);
- $this->db = $db;
- $db['second'] = array(
- 'dsn' => '',
- 'hostname' => 'localhost',
- 'username' => 'root',
- 'password' => '',
- 'database' => 'nomedobanco',
- 'dbdriver' => 'mysqli',
- 'dbprefix' => '',
- 'pconnect' => FALSE,
- 'db_debug' => (ENVIRONMENT !== 'production'),
- 'cache_on' => FALSE,
- 'cachedir' => '',
- 'char_set' => 'utf8',
- 'dbcollat' => 'utf8_general_ci',
- 'swap_pre' => '',
- 'encrypt' => FALSE,
- 'compress' => FALSE,
- 'stricton' => FALSE,
- 'failover' => array(),
- 'save_queries' => TRUE
- );
- //$db2 = $this->load->database('second', TRUE);
- $this->db2 = $db;
- }
Add Comment
Please, Sign In to add comment