Difference between #3 and #4 of
Yii v2 snippet guide II

Revision #4 has been created by rackycz on Sep 2, 2020, 5:44:03 AM with the memo:

mssql
« previous (#3) next (#5) »

Changes

Title unchanged

Yii v2 snippet guide II

Category unchanged

Tutorials

Yii version unchanged

2.0

Tags unchanged

tutorial,beginner,yii2,snippets

Content changed

[...]
- [https://www.yiiframework.com/wiki/250/yii-for-beginners](https://www.yiiframework.com/wiki/250/yii-for-beginners)
- [https://www.yiiframework.com/wiki/462/yii-for-beginners-2](https://www.yiiframework.com/wiki/462/yii-for-beginners-2)

**Connection to MSSQL**
---
You
mightwill need MSSQL drivers in PHP. Programatically you can list them or test their presence like this:
 
 
```php
 
var_dump(\PDO::getAvailableDrivers());
 
 
if (in_array('sqlsrv', \PDO::getAvailableDrivers())) {
 
  // ... MsSQL driver is available, do something
 
}
 
```
 
 
Based on your system you have to download different driver. The differences are x64 vs x86 and ThreadSafe vs nonThreadSafe. In Windows I always use ThreadSafe.
[Explanation](https://www.php.net/manual/en/faq.obtaining.php#faq.obtaining.threadsafety).

Newest PHP drivers are [here](https://docs.microsoft.com/en-us/sql/connect/php/download-drivers-php-sql-server).
- Drivers v5.8 = PHP 7.2 - 7.4
[...]
4 0
3 followers
Viewed: 75 379 times
Version: 2.0
Category: Tutorials
Written by: rackycz
Last updated by: rackycz
Created on: Aug 26, 2020
Last updated: 3 years ago
Update Article

Revisions

View all history