CodeIgniter Forums
DMZ & Multiple DBs !! any idea? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: DMZ & Multiple DBs !! any idea? (/showthread.php?tid=35229)



DMZ & Multiple DBs !! any idea? - El Forum - 10-23-2010

[eluser]7amza[/eluser]
hey
im using the dmz library and i want to use multiple databases .
i have read the config section in the dmz library user guide but i didn't understood it very well , i read the CI user guide multiple databases section guide as well as and all goes good with it.
thank you .


DMZ & Multiple DBs !! any idea? - El Forum - 10-23-2010

[eluser]WanWizard[/eluser]
In the config/database.php you can define multiple named database connection.

Without extra configuration, DataMapper uses whatever you have defined as 'default' in this configuration.

You can override that for all DataMapper models by setting the config value 'db_params' to another database configuration in config/datamapper.php.

If you want a per-model override, you can add this to a model:
Code:
/**
* override the database connections with this option
*/
var $db_params = 'db_config_name';