<?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)); }
为啥连接只需要提供服务器名字就可以,连接本机的和内网或者外网的服务器都是这样吗?
给个名字就能找到要连的原理是啥?
杨__羊羊