A
A
alexlb2015-11-16 12:42:20
Yii
alexlb, 2015-11-16 12:42:20

How to access MSSQL 2008 from YII2?

Here's what I found out:
Yii2 works on php > 5.4
In php 3 drivers for working with MSSQL
2 of them work in php <5.3
And the third sqldrv in 2 versions:
v2 only php <=5.3 and mssql 2008
v3 php >= 5.4 mssql > 2012.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
shagguboy, 2015-11-16
@alexlb

https://msdn.microsoft.com/en-us/library/cc296170%...
The SQLSRV extension provides a procedural interface while the PDO_SQLSRV extension implements PDO for accessing data in all editions of SQL Server 2005 and later (versions 3.2 and 3.1 require SQL Server 2008 and later).

M
matperez, 2015-11-16
@matperez

Most likely not. At the beginning of the year, I needed to periodically import something into MSSQL 2008, I had to write it in explosive 5.2. There were no sane solutions for 5.4 under Windows. And in Linux everything seemed to work through mssql , php 5.4.

A
alexlb, 2015-11-16
@alexlb

I'm still trying to get it to work through ODBC, although I can hardly imagine what it is.

'db2' => [
            'class' => 'yii\db\Connection',
            'driverName'=>'sqlsrv',
            'dsn' => 'odbc:Driver={SQL Server};Server=10.10.10.10:1111;Database=db_test;Uid=user;Pwd=pass;',
            'username' => 'user',
            'password' => 'pass',
        ],

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question