PHP – Connecting to SQL Server with Windows Authentication


<?php
$serverName      = “(local)”;
$databaseName = “TEST”;
$connectionOptions = array(“Database”=>$databaseName);

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

if ($conn === false){
die(FormatErrors(mssql_errors()));
}

echo ‘connection succeed!’;
?>

2 thoughts on “PHP – Connecting to SQL Server with Windows Authentication

  1. Thanks Brian, You’re awesome !!!

    I use mssql driver to connect to SQL Server 2000 box and now I have follow your links which point to your article on how to use sqlsrv driver, now I use sqlsrv driver to connect to SQL Server 2005 box

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s