我想使用 PHP 连接到 sql server 数据库。
我安装了 xampp 1.7.0(php 5.2) 和 SQLSRV20。我已经添加了扩展php.ini
,我收到了这个错误:
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to
server: 10.85.80.229 in C:\xampp\htdocs\xampp\test.php on line 07
代码:
<?php
$myServer = "10.85.80.229";
$myUser = "root";
$myPass = "pass";
$myDB = "testdb";
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
?>
此错误消息是什么意思以及如何连接到 SQL Server?