My current company uses SQL Server as their database. I already installed MS SQL Server Management Studio on my machine. I use xampp.
My xampp control panel version is 3.2.2
My PHP Version is 7.2.12
*In my phpinfo the driver was not loaded :(
What I have tried so far:
1) I added to my php extension php_pdo_sqlsrv_72_ts_x64.dll
and declare it to my php.ini
as extension=php_pdo_sqlsrv_72_ts_x64
Here's my code in php:
<?php
$serverName = "DESKTOP-LPQGPQK\MSSQL14";
/* Connect using Windows Authentication. */
try
{
$conn = new PDO( "sqlsrv:server=$serverName ; Database=testdb", "sa","kert");
$conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
}
catch(Exception $e)
{
die( print_r( $e->getMessage() ) );
}
The output in my localhost\phpdev
is: could not find driver1