I don't know if this is the right question but i'm working with MSSQL and PHP, and just installed the driver for PHP SqlSrv.
(You need to add an extension from Microsoft to work with MsSql because PHP don't support mssql_connect anymore)
But now i'm not sure how to add support for that driver in visual studio code, where it says i'm using a undefined function.
Is there some way to integrate the two or do i just need to be content that it works?
$serverName = "serverName\\sqlexpress"; //serverName\instanceName
$connectionInfo = array( "Database"=>"dbName", "UID"=>"userName", "PWD"=>"password");
$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));
}
?>
I use:
Windows 10, PHP 7.2.1.1, Laragon, php_pdo_sqlsrv-5.8.1-7.2-ts-vc15-x64, php_sqlsrv-5.8.1-7.2-ts-vc15-x64.