I am trying to make laravel work with mssql and i always get this error:
"SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (192.168.1.1:1433) (severity 9) (SQL: SELECT GETDATE()) (View: /resources/views/teste.blade.php)"
but if i try a simple script:
<?php
try {
$hostname = "192.168.1.1";
$port = 1433;
$dbname = "some_db";
$username = "some_user";
$pw = "some_pass";
$dbh = new PDO ("dblib:host=$hostname:$port;dbname=$dbname","$username","$pw");
} catch (PDOException $e) {
echo "Failed to get DB handle: " . $e->getMessage() . "\n";
exit;
}
$stmt = $dbh->prepare("select getdate()");
$stmt->execute();
while ($row = $stmt->fetch()) {
print_r($row);
}
unset($dbh); unset($stmt);
?>
it works fine.... does laravel needs any special config or doesn't use pdo ?