Created
September 4, 2012 14:25
-
-
Save mpmont/3621634 to your computer and use it in GitHub Desktop.
double connection codeigniter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
| $active_group = 'default'; | |
| $active_record = TRUE; | |
| $db['default']['hostname'] = 'localhost'; | |
| $db['default']['username'] = 'username'; | |
| $db['default']['password'] = 'password'; | |
| $db['default']['database'] = 'myDatabase'; | |
| $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['mssql']['hostname'] = 'localhost'; | |
| $db['mssql']['username'] = 'username'; | |
| $db['mssql']['password'] = 'password'; | |
| $db['mssql']['database'] = 'myseconddatabase'; | |
| $db['mssql']['dbdriver'] = 'mssql'; | |
| $db['mssql']['dbprefix'] = ''; | |
| $db['mssql']['pconnect'] = TRUE; | |
| $db['mssql']['db_debug'] = TRUE; | |
| $db['mssql']['cache_on'] = FALSE; | |
| $db['mssql']['cachedir'] = ''; | |
| $db['mssql']['char_set'] = 'utf8'; | |
| $db['mssql']['dbcollat'] = 'utf8_general_ci'; | |
| $db['mssql']['swap_pre'] = ''; | |
| $db['mssql']['autoinit'] = TRUE; | |
| $db['mssql']['stricton'] = FALSE; | |
| /* End of file database.php */ | |
| /* Location: ./application/config/database.php */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
| class Example_model extends CI_Model { | |
| public function __construct() | |
| { | |
| parent::__construct(); | |
| $this->db_mssql = $this->load->database('mssql', TRUE); | |
| } | |
| public function get_all() { | |
| return $this->db_mssql->get('examples'); | |
| } | |
| } | |
| /* End of file Example_model.php */ | |
| /* Location: ./application/models/example_model.php */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment