具体代码应该如何实现
<?php
$serverName = "localhost"; //数据库服务器地址
$uid = "sa"; //数据库用户名
$pwd = ""; //数据库密码
$connectionInfo = array("UID" => $uid, "PWD" => $pwd, "Database" => "Students");
$conn = sqlsrv_connect($serverName, $connectionInfo);
if ($conn == false) {
echo "连接失败!";
var_dump(sqlsrv_errors());
exit;
} else {
echo "链接成功";
}
?>
此代码报错
Fatal error: Uncaught Error: Call to undefined function sqlsrv_connect() in D:\phpstudy_pro\WWW\t.php:6 Stack trace: #0 {main} thrown in D:\phpstudy_pro\WWW\t.php on line 6