What are the differences in syntax between connecting to a MSSQL database in ASP and PHP?

When connecting to a MSSQL database in ASP, the syntax involves using ADO (ActiveX Data Objects) to establish a connection and execute queries. In PHP, the syntax for connecting to a MSSQL database typically involves using the PDO (PHP Data Objects) extension or the mssql_connect function. The key difference lies in the specific functions and methods used in each language to interact with the database.

// PHP code snippet for connecting to a MSSQL database using PDO
$serverName = "your_server_name";
$connectionOptions = array(
    "Database" => "your_database_name",
    "Uid" => "your_username",
    "PWD" => "your_password"
);

$conn = sqlsrv_connect($serverName, $connectionOptions);

if($conn) {
    echo "Connected to MSSQL database successfully";
} else {
    echo "Connection could not be established";
}