无法使用sqlserver连接到数据库?
cannot connect to database with sqlserver?
我有 ampp3.9-PHP7.3 和 SQLserver-2014 12.0.2269.0。我无法连接数据库。我收到以下错误
Fatal error: Uncaught Error: Call to undefined function
sqlsrv_connect() in E:\Ampps\Ampps\www\backend scripts\database.php:4
Stack trace: #0 {main} thrown in E:\Ampps\Ampps\www\backend
scripts\database.php on line 4
这是我的代码
<?php
$serverName = "DESKTOP-VDSPQT9"; //serverName\instanceName
$connectionInfo = array( "Database"=>"railway", "UID"=>"sa", "PWD"=>"bhanu123");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn ) {
echo "Connection established.<br />";
}else{
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}
?>
我有 ampp3.9-PHP7.3 和 SQLserver-2014 12.0.2269.0。我无法连接数据库。我收到以下错误
Fatal error: Uncaught Error: Call to undefined function sqlsrv_connect() in E:\Ampps\Ampps\www\backend scripts\database.php:4 Stack trace: #0 {main} thrown in E:\Ampps\Ampps\www\backend scripts\database.php on line 4
这是我的代码
<?php
$serverName = "DESKTOP-VDSPQT9"; //serverName\instanceName
$connectionInfo = array( "Database"=>"railway", "UID"=>"sa", "PWD"=>"bhanu123");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn ) {
echo "Connection established.<br />";
}else{
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}
?>