2016-07-13 186 views
0

我有一个WAMPSERVER 2.5开发服务器。它运行PHP 5.512。从WAMPSERVER 2.5连接到SQL服务器上的数据库

我试图连接到我们的实时SQL Server。我已经安装并激活了版本32 files,并用下面的代码:

<?php 

$link = sqlsrv_connect('obscured_ip:obscured_port', array('Database'=>'obscured_database','UID'=>'obscured_uid', 'PWD'=>'obscured pwd')); 

if (!$link) 
    die(print_r(sqlsrv_errors(), true)); 

?> 

,我发现了以下错误:

Array ([0] => Array ([0] => IMSSP [SQLSTATE] => IMSSP 1 => -49 [code] => -49 2 => This extension requires the Microsoft ODBC Driver 11 for SQL Server. Access the following URL to download the ODBC Driver 11 for SQL Server for x86: http://go.microsoft.com/fwlink/?LinkId=163712 [message] => This extension requires the Microsoft ODBC Driver 11 for SQL Server. Access the following URL to download the ODBC Driver 11 for SQL Server for x86: http://go.microsoft.com/fwlink/?LinkId=163712 ) 1 => Array ([0] => IM002 [SQLSTATE] => IM002 1 => 0 [code] => 0 2 => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified [message] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified))

指定那里link只是把我带回到司机下载页面。我究竟做错了什么?

+1

您是否安装了[用于SQL Server的Microsoft ODBC驱动程序11](https://www.microsoft.com/en-us/download/details.aspx?id=36434) – RiggsFolly

+0

@RiggsFolly - 我没有 - 错误信息中提供的URL是错误的,这将我扔掉了。 – BFWebAdmin

回答

相关问题