谁有php连接sqlserver 2008实例,能用的,给我一份,谢谢!
1个回答
展开全部
header(“content-type:text/html; charset=utf-8″);
$serverName = “(localhost)”;
$uid = “用户名”;
$pwd = “密码”;
$connectionInfo = array(“UID”=>$uid,”PWD”=>$pwd,”Database”=>”dbo.test”);
$conn = sqlsrv_connect( $serverName,$connectionInfo);
if( $conn == false)
{
echo “连接失败!”;
die( print_r( sqlsrv_errors(), true));
}
else
echo 'success';
?>
$serverName = “(localhost)”;
$uid = “用户名”;
$pwd = “密码”;
$connectionInfo = array(“UID”=>$uid,”PWD”=>$pwd,”Database”=>”dbo.test”);
$conn = sqlsrv_connect( $serverName,$connectionInfo);
if( $conn == false)
{
echo “连接失败!”;
die( print_r( sqlsrv_errors(), true));
}
else
echo 'success';
?>
追问
不行…很多网上的我都试过了,已经搞了快一个月还是没搞好
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询