I'm using the following code to try and connect using:
try {
$hostname = "***********";
$port = *****;
$dbname = "******";
$username = "******";
$pw = "********";
$dbh = new PDO ("sqlsrv:host=$hostname:$port;dbname=$dbname","$username","$pw");
} catch (PDOException $e) {
echo "Failed to get DB handle: " . $e->getMessage() . "
";
exit;
}
but I'm getting the following error:
Failed to get DB handle: could not find driver
How do I fix this error?
I've seen other answers say that I should have "SQL Server PDO Driver" installed. Is there a way to check this is installed?