1
2
3
4
5
6
7
8
9
10
11
12
| <?php
$serverName = "127.0.0.1,1433"; //serverNameinstanceName, portNumber (default is 1433)
$connectionInfo = array( "Database"=>"demo", "UID"=>"sa", "PWD"=>"pass");
$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));
}
?>
|