Connecting to your SQL Server Database using the SQL Server Driver for PHP is easy. To open a connection, simply call the sqlsrv_connect function and specify the name of the desired server. An instance name (ServerNameInstanceName) can be supplied if you’re trying to connect to a named instance of SQL Server. If you want to talk to an instance of SQL Server running on the same machine as your PHP code, you can specify either ’(local)’ or ’.’ as the server name. For example, the following line of code establishes a connection to the local machine.