maxdb_get_proto_info

maxdb::protocol_version

(PECL maxdb >= 1.0)

maxdb_get_proto_info -- maxdb::protocol_versionReturns the version of the MaxDB protocol used

说明

过程化风格

maxdb_get_proto_info ( resource $link ) : int

面向对象风格

string $maxdb->protocol_version;

Returns an integer representing the MaxDB protocol version used by the connection represented by the link parameter.

返回值

Returns an integer representing the protocol version (constant 10).

范例

Example #1 面向对象风格

<?php
$maxdb 
= new maxdb("localhost""MONA""RED""DEMODB");

/* check connection */
if (maxdb_connect_errno()) {
   
printf("Connect failed: %s\n"maxdb_connect_error());
   exit();
}

/* print protocol version */
printf("Protocol version: %d\n"$maxdb->protocol_version);

/* close connection */
$maxdb->close();
?>

Example #2 过程化风格

<?php
$link 
maxdb_connect("localhost""MONA""RED""DEMODB");

/* check connection */
if (maxdb_connect_errno()) {
   
printf("Connect failed: %s\n"maxdb_connect_error());
   exit();
}

/* print protocol version */
printf("Protocol version: %d\n"maxdb_get_proto_info($link));

/* close connection */
maxdb_close($link);
?>

以上例程的输出类似于:

Protocol version: 10

参见

相关文章
php ibm db2 函数 returns the cursor type used by a statement resourcephp maxdb 函数 returns an array of resources representing the fields in a result setphp maxdb 函数 returns the lengths of the columns of the current row in the result setphp maxdb 函数 returns the current row of a result set as an objectphp maxdb 函数 returns the number of columns for the most recent queryphp maxdb 函数 returns a string representing the type of connection usedphp maxdb 函数 returns the version of the maxdb protocol usedphp maxdb 函数 initializes maxdb and returns an resource for use with maxdb real connectphp maxdb 函数 returns the auto generated id used in the last queryphp maxdb 函数 returns rpl query typephp maxdb 函数 returns the total number of rows changed deleted or inserted by the last executed statementphp maxdb 函数 returns the error code for the most recent statement callphp maxdb 函数 returns result set metadata from a prepared statementphp maxdb 函数 returns sqlstate error from previous statement operationphp maxdb 函数 returns the thread id for the current connectionphp maxdb 函数 returns whether thread safety is given or notphp postgresql 函数 returns an array with client protocol and server version when available php zlib 函数 returns the coding type used for output compressionphp mysqlnduhconnection returns the version of the mysql protocol usedphp sdo das relational 函数 returns the special root object in an otherwise empty data graph. used when creating a data graph from scratch
关注编程学问公众号