Database settings for Model |
[eluser]Webjema[/eluser]
As you know the Model can has different DB connections and hence other DB settings for these connections. I need another DB connection for one of my Models. And I want to keep DB settings together in database.php How can I send DB settings from database.php to Model? I looked through database classes and found that database.php is being used once and data from that file is not being saved. I suggest only one method - to include database.php before creating Model. Do you have any other ideas?
[eluser]InsiteFX[/eluser]
Hi, First off you need to read the CodeIgniter Users Guide! You will find almost everything you need there. But here is the page from the Users Guide. CodeIgniter Users Guide Database Enjoy InsiteFX
[eluser]Webjema[/eluser]
Or I have to go to Model __constructor and call $this->load->database('group_name'); ?
[eluser]InsiteFX[/eluser]
Hi, you can setup your config database.php like this. Code: $active_group = "default"; Change production to your other own name then you can load the one you want. Enjoy InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |