php 连接sqlserver
时间:2021-07-01 10:21:17
帮助过:26人阅读
header("Content-type: text/html; charset=utf-8"
);
try {
$dbName = "sqlsrv:Server=服务器名称;Database=数据库名称"
;
$dbUser = "用户名"
;
$dbPassword = "密码"
;
$db =
new PDO(
$dbName,
$dbUser,
$dbPassword);
if(
$db) {
echo "连接成功"
;
}else{
echo "连接失败"
;
}
}
catch(PDOException
$e) {
$content =
$e->
getMessage();
echo $content;
}
?>
原文链接:https://blog.csdn.net/weixin_42148217/article/details/90289874
php 连接sqlserver
标签:php版本 tps system 地址 art get tail message connect