-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdb.php
More file actions
15 lines (14 loc) · 870 Bytes
/
db.php
File metadata and controls
15 lines (14 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
try {
$conn = new PDO("sqlsrv:server = tcp:lifelineserver.database.windows.net,1433; Database = lifelinesqldb", "akhil", "Inevitables@123");
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch (PDOException $e) {
print("Error connecting to SQL Server.");
die(print_r($e));
}
// SQL Server Extension Sample Code:
$connectionInfo = array("UID" => "akhil", "pwd" => "Inevitables@123", "Database" => "lifelinesqldb", "LoginTimeout" => 30, "Encrypt" => 1, "TrustServerCertificate" => 0);
$serverName = "tcp:lifelineserver.database.windows.net,1433";
$conn = sqlsrv_connect($serverName, $connectionInfo);
?>