Session is not working in database.php file |
[eluser]web_developer[/eluser]
I have dynamic site database.. I have to load database according to site wise, I have DB settings in session variable. But it doesn't working in database.php file.. Can anyone suggest? how can I get session variable in database.php file? Code: $active_group = 'mysite';
[eluser]jjDeveloper[/eluser]
Codeigniters session class might be a better alternative as your db credentials are currently available to anyone on the server. Plus you would be able to use it in your model.
[eluser]CroNiX[/eluser]
If you want to do that, why don't you just pass in the configuration array instead of using the database config file? You can do it manually. Code: $this->load->database($config);
[eluser]Aken[/eluser]
Also consider using the ENVIRONMENT constant to set the appropriate environment, instead of directly using session variables. |
Welcome Guest, Not a member yet? Register Sign In |