配置应该没有什么问题了,因为我用phpinfo();已经看到加载了mssql模块。
而我使用PHP连接局域网内的另一台机器的时候确报错,找了很多方法都没有得到解决。错误信息如下
Warning: mssql_connect() [function.mssql-connect]: message: 用户 'sa' 登录失败。原因: 未与信任 SQL Server 连接相关联。 (severity 14) in D:\webroot\test.php on line 6Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: 192.168.0.4 in D:\webroot\test.php on line 6Warning: Cannot modify header information - headers already sent by (output started at D:\MYOA\webroot\test.php:6) in D:\webroot\test.php on line
请有过类似经验的高手,帮我分析和解决 一下。谢谢了
而我使用PHP连接局域网内的另一台机器的时候确报错,找了很多方法都没有得到解决。错误信息如下
Warning: mssql_connect() [function.mssql-connect]: message: 用户 'sa' 登录失败。原因: 未与信任 SQL Server 连接相关联。 (severity 14) in D:\webroot\test.php on line 6Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: 192.168.0.4 in D:\webroot\test.php on line 6Warning: Cannot modify header information - headers already sent by (output started at D:\MYOA\webroot\test.php:6) in D:\webroot\test.php on line
请有过类似经验的高手,帮我分析和解决 一下。谢谢了
$hostname="192.168.0.4"; //MSSQL服务器的IP地址 或 服务器的名字
$dbuser="sa"; //MSSQL服务器的帐号
$dbpasswd="sa"; //MSSQL服务器的密码
$dbname="newsdb"; //数据库的名字
$conn = mssql_connect($hostname,$dbuser,$dbpasswd); //连接MSSQL
if ($conn) {
header( "location:http://www.baidu.com" );
}else {
header( "location:http://www.163.com" );
}贴上简单的代码
我没碰过这种问题
找篇文章
http://crazy.139now.com/blog/15