使用WAMPServer

时间:2017-06-24 12:13:40

标签: php sql wamp

我无法使用我的php cod连接sql server,我使用的是5.6 PHP版本 这是我的连接代码

<?php
$serverName = "IMMY-PC"; 
$connectionInfo = array( "Database"=>"AdventureWorksDW2014", "UID"=>"xxx", "PWD"=>"xxx");
$conn = sqlsrv_connect( $serverName, $connectionInfo);

if( $conn ) {
     echo "Connection established.<br />";
}else{
     echo "Connection could not be established.<br />";
     die( print_r( sqlsrv_errors(), true));
}
?>

在php.in中我添加了extension= php_pdo_sqlsrv_56_nts.dllextension=php_pdo_sqlsrv_56_ts.dll

连接期间

错误

( ! ) Fatal error: Call to undefined function sqlsrv_connect() in
C:\wamp64\www\check\const.php on line 4 Call Stack
#   Time    Memory  Function    Location 
1   0.0010  235560  {main}( )   ...\const.php:0

我是PHP新手,请帮帮我

0 个答案:

没有答案