Microsoft Drivers for PHP for SQL Server version 2.0 and 3.0 |
sqlsrv_client_info |
Example See Also Send Feedback |
Returns information about the connection and client stack.
Syntax
sqlsrv_client_info( resource $conn) |
Parameters
$conn: The connection resource by which the client is connected.
Return Value
An associative array with keys described in the table below, or false if the connection resource is null.
Key |
Description |
---|---|
DriverDllName |
SQLNCLI10.DLL (Microsoft Drivers for PHP for SQL Server version 2.0) |
DriverODBCVer |
ODBC version (xx.yy) |
DriverVer |
SQL Server Native Client DLL version: 10.50.xxx (Microsoft Drivers for PHP for SQL Server version 2.0) |
ExtensionVer |
php_sqlsrv.dll version: 2.0.xxxx.x(Microsoft Drivers for PHP for SQL Server version 2.0) |
Example
The following example writes client information to the console when the example is run from the command line. The example assumes that SQL Server is installed on the local computer. All output is written to the console when the example is run from the command line.
Copy Code | |
---|---|
<?php /*Connect to the local server using Windows Authentication and specify the AdventureWorks database as the database in use. */ $serverName = "(local)"; $conn = sqlsrv_connect( $serverName); if( $conn === false ) { echo "Could not connect.\n"; die( print_r( sqlsrv_errors(), true)); } if( $client_info = sqlsrv_client_info( $conn)) { foreach( $client_info as $key => $value) { echo $key.": ".$value."\n"; } } else { echo "Client info error.\n"; } /* Close connection resources. */ sqlsrv_close( $conn); ?> |