how to connect to another database on the same server
Notice: This thread is very old.
- japlavaren
- Member | 404
you should use different database section: nette.database.default is for default connection
- Filip Procházka
- Moderator | 4668
You have to configure your connections like this
database:
default:
dsn: 'mysql:host=xxx;dbname=account'
user: xxx
password: xxx
another:
dsn: 'mysql:host=xxx;dbname=account'
user: xxx
password: xxx
And then you pass the connections to your services
services:
- App\ArticlesModel(@nette.database.default)
- App\DataImportModel(@nette.database.another)
Last edited by Filip Procházka (2014-07-27 23:15)