Connecting to MS SQL database as secondary database connection Failing
Permalink
I started by looking at this code http://documentation.concrete5.org/developers/database-management/c...
instead of 'driver' => 'c5_pdo_mysql' i used 'driver' => 'c5_pdo_sqlsrv',
but then ran into an error because there was not class for it, so I created
/concrete/src/database/driver/PDPSqlsrvConcrete5/Driver.php
Now i get error
Class '\Concrete\Core\Database\Driver\PDOSqlsrv\Driver' not found
Though the file is there.
Maybe I just went in the wrong direction. Any assisntance is appreciated.
instead of 'driver' => 'c5_pdo_mysql' i used 'driver' => 'c5_pdo_sqlsrv',
but then ran into an error because there was not class for it, so I created
/concrete/src/database/driver/PDPSqlsrvConcrete5/Driver.php
Now i get error
Class '\Concrete\Core\Database\Driver\PDOSqlsrv\Driver' not found
Though the file is there.
Maybe I just went in the wrong direction. Any assisntance is appreciated.
SO instead of the SQLsrv driver, I have PDOSqlsrv on my system, so i changed your code for driver array to
'pdo_sqlsrv' => 'Doctrine\DBAL\Driver\PDOSqlsrv\Driver'
only thing is now i get an error
Call to undefined method Doctrine\DBAL\Driver\PDOStatement::fetchRow()
Im going to try to get SQLSrv installed on on server, but not sure if that will do it.
'pdo_sqlsrv' => 'Doctrine\DBAL\Driver\PDOSqlsrv\Driver'
only thing is now i get an error
Call to undefined method Doctrine\DBAL\Driver\PDOStatement::fetchRow()
Im going to try to get SQLSrv installed on on server, but not sure if that will do it.
Nope fetchRow is a deprecated concrete5 function. It's new form is just ->fetch() which should be common across the other doctrine drivers I believe.
For a list of these check out Concrete\Core\Database\Driver\PDOStatement they are just there for backwards compatibility but you shouldn't be using them in new development.
For a list of these check out Concrete\Core\Database\Driver\PDOStatement they are just there for backwards compatibility but you shouldn't be using them in new development.
By default ONLY the c5_pdo_mysql driver is registered, you need to register the appropriate driver. So you database.php file in your config might end up looking something closer to this:
Notice how I had to register my driver as 'pdo_sqlsrv', and map it to an actual driver implementation class. You'll need to find the appropriate driver for your needs. Best of luck!