I'm trying to open a connection to Amazon RDS MS-SQL
from Hosting with MSSQL
library with following code:
<?php
$dbhost = "xxxxxxx.rds.amazonaws.com";
$dbport = 1433;
$dbname = "xxxxx";
$dbuser = "xxxxxx";
$dbpass = "xxxxxxx";
try {
$dbh = new PDO ("dblib:host=$dbhost:$dbport;dbname=$dbname","$dbuser","$dbpass");
} catch (PDOException $e) {
echo "Failed to get DB handle: " . $e->getMessage() . "
";
exit;
}
and I am getting this error:
Failed to get DB handle: SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (severity 9)