mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
15 lines
345 B
PHP
15 lines
345 B
PHP
<?php
|
|
// Setup the connection
|
|
$serverName = "localhost";
|
|
$connectionOptions = [
|
|
"Database" => "SampleDB",
|
|
"Uid" => "sa",
|
|
"PWD" => "your_password"
|
|
];
|
|
|
|
// Establish the connection
|
|
$connection = sqlsrv_connect($serverName, $connectionOptions);
|
|
if ($connection) {
|
|
echo "Connected!";
|
|
}
|