php8.5
Home/ Manual/ sqlsrv / functions/ sqlsrv_client_info

sqlsrv_client_info

PHP function Edit on GitHub ✎

Returns information about the client and specified connection

Description

sqlsrv_client_info(resource $conn): array

Returns information about the client and specified connection

Parameters

conn

The connection about which information is returned.

Return Values

Returns an associative array with keys described in the table below. Returns false otherwise.

KeyDescription
DriverDllNameSQLNCLI10.DLL
DriverODBCVerODBC version (xx.yy)
DriverVerSQL Server Native Client DLL version (10.5.xxx)
ExtensionVerphp_sqlsrv.dll version (2.0.xxx.x)

Examples

sqlsrv_client_info() example

php
<?php
$serverName = "serverName\sqlexpress";
$connOptions = array("UID"=>"username", "PWD"=>"password");
$conn = sqlsrv_connect( $serverName, $connOptions );

if( $conn === false ) {
    die( print_r( sqlsrv_errors(), true));
}

if( $client_info = sqlsrv_client_info( $conn)) {
    foreach( $client_info as $key => $value) {
        echo $key.": ".$value."<br />";
    }
} else {
    echo "Error in retrieving client info.<br />";
}
?>

See Also

Source: reference/sqlsrv/functions/sqlsrv-client-info.xml · from the official PHP manual (php/doc-en)