I’m trying to connect on windows
my php code with SQL Server(windows authentication). I am using xampp.
This is my code but it’s not working.
<?php
$dbPassword = "";
$dbUserName = "Inspiron/xxxxx";
$dbServer = "localhost";
$dbName = "person";
// $conn = mysqli_connect($dbServer , $dbUserName , $dbPassword,$dbName) or die("unable to connect to host");
$connectionInfo = array( "Database"=>$dbName);
$conn = sqlsrv_connect( $dbServer, $connectionInfo);
if( $conn ) {
echo "Connection established.<br />";
}else{
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}
?>
ERROR
Fatal error: Uncaught Error: Call to undefined function sqlsrv_connect() in C:\xampp\htdocs\connection\connection.php:12 Stack trace: #0 C:\xampp\htdocs\connection\phpAdd.php(2): require() #1 {main} thrown in C:\xampp\htdocs\connection\connection.php on line 12
Could someone help my or give me some links to read?