Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How set dynamic database host names #44

Open
newbie14 opened this issue Jul 2, 2018 · 0 comments
Open

How set dynamic database host names #44

newbie14 opened this issue Jul 2, 2018 · 0 comments

Comments

@newbie14
Copy link

newbie14 commented Jul 2, 2018

Current below is my settings.php

[ 'displayErrorDetails' => true, // set to false in production 'addContentLengthHeader' => false, // Allow the web server to send the content-length header // Renderer settings 'renderer' => [ 'template_path' => __DIR__ . '/../templates/', ], // Monolog settings 'logger' => [ 'name' => 'slim-app', 'path' => isset($_ENV['docker']) ? 'php://stdout' : __DIR__ . '/../logs/app.log', 'level' => \Monolog\Logger::DEBUG, ], "db" => [ "host" => "localhost", "dbname" => "***", "user" => "***1", "pass" => "***" ], ], ]; With this settings it works perfectly in the route when I called this e.g. $selectQueryResult1 = $this->db->prepare($selectQuery1) The issue now I will want to have many different database e.g. db1, db2; when I set new settings in the settings file I always get this error /var/www/html/apiv1/vendor/slim/slim/Slim/Container.php(172): Slim\Container->get('db1') How can I set and call those extra database settings?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant