Using the SQLSRV driver of the Microsoft Drivers for PHP for SQL Server, the following example uses the Windows Authentication to connect to a local instance of SQL Server. After the connection has been established, the server is queried for the login of the user who is accessing the database.
The following example uses the SQLSRV driver with SQL Server Authentication to connect to a local instance of SQL Server.