Welcome Guest, Not a member yet? Register   Sign In
multi database
#1

[eluser]Unknown[/eluser]
Is it posible to use three diffrent database systems in one codeigniter application?
I need to connect to PostgreSQL and after that check something in Oracle database and at last find data in MSSQL database so i need at once to oparate on this three databses.
So my question is can i do that by ActiveRecord methods?

regards
Peter
#2

[eluser]TheFuzzy0ne[/eluser]
Welcome to the CodeIgniter forums.

There are probably several ways to do what you want. Assuming you have the configuration for each of your databases in ./system/application/config/database.php, I'd do something like this:

Code:
$this->db1 = $this->load->database('db1', TRUE);
$this->db2 = $this->load->database('db2', TRUE);
$this->db3 = $this->load->database('db3', TRUE);

The db* as the first parameter represents the name of the database group as written in ./system/application/config/database.php.

Hope this helps.




Theme © iAndrew 2016 - Forum software by © MyBB