Skip to content

Instantly share code, notes, and snippets.

@nucreativa
Last active April 25, 2018 22:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nucreativa/03d0812049c4bcb5c476 to your computer and use it in GitHub Desktop.
Save nucreativa/03d0812049c4bcb5c476 to your computer and use it in GitHub Desktop.
How to make connection SQL Server 2000 in PHP 5.4
http://robsphp.blogspot.com/2012/09/how-to-install-microsofts-sql-server.html
https://stackoverflow.com/questions/19783613/how-to-connect-to-mssql-2000-from-php-5-3-and-up/19787528#19787528
https://onedrive.live.com/?cid=669ee24817961774&id=669EE24817961774%21720
<?php
$serverName = "serverName\sqlexpress"; //serverName\instanceName
// Since UID and PWD are not specified in the $connectionInfo array,
// The connection will be attempted using Windows Authentication.
$connectionInfo = array( "Database"=>"dbName");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn ) {
echo "Connection established.<br />";
}else{
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment