• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I use mutil-databases group??

#1
[eluser]Unknown[/eluser]
Hi there.
I want to use several databases group in a server.
I have been searching for this but some of them are not for the latest version of CI.
Anyways I figured it out that I can access other DB group with following code:
Code:
$this->db_name = $this->load->database('db_name',TRUE);
and I can use it like this:
Code:
$this->db_name->get('table_name');

But I don't want to type every time when I tried to access other DB group.
How can I load the first line of code automatically in the Controller or Model so I can just use the second line of the code above.

I think there are some way like modifying session.php or make my own library etc.
But I don't get it yet.
Would somebody help me, please?
Thank you!

P.s sorry for my bad English, it's my second language.




Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.