docker-php-extension-installer/scripts/tests/pdo_sqlsrv
2021-09-28 12:27:17 +02:00

14 lines
445 B
PHP
Executable File

#!/usr/bin/env php
<?php
require_once __DIR__ . '/_bootstrap.php';
try {
new PDO('sqlsrv:server=localhost; Authentication=SqlPassword; ConnectRetryCount=0; Database=example; LoginTimeout=1', 'userName', 'password');
} catch (PDOException $x) {
if (stripos($x->getMessage(), 'This extension requires the Microsoft ODBC Driver for SQL Server') !== false) {
fwrite(STDERR, trim($x->getMessage() . "\n"));
exit(1);
}
}