Answer the question
In order to leave comments, you need to log in
What is the error when trying to connect to MS SQL via PDO_SQLSRV?
You need to configure the webserver to connect to the MS SQL database.
Wednesday: Windows NT 6.0, IIS 8.0, PHP 7.0.1
I did everything according to the instructions. I installed the php driver downloaded from the microsoft site ( php_pdo_sqlsrv_7_nts_x64.dll), added the extension to php.ini. I updated the server, the pdo_sqlsrv entry appeared in phpinfo.
Run the db connection script
$serverName = "имя сервера";
$database = "имя базы";
$uid = "имя пользователя";
$pwd = "пароль";
$conn = new PDO( "sqlsrv:server=$serverName;database=$database", $uid, $pwd);
Answer the question
In order to leave comments, you need to log in
NETWORK_NAME\user_name
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question