maxdb_get_host_info

maxdb::get_host_info

(PECL maxdb >= 1.0)

maxdb_get_host_info -- maxdb::get_host_infoReturns a string representing the type of connection used

说明

过程化风格

maxdb_get_host_info ( resource $link ) : string

面向对象风格

string $maxdb->host_info;

The maxdb_get_host_info() function returns a string describing the connection represented by the link parameter is using.

返回值

A character string representing the server hostname and the connection type.

范例

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 host information */
printf("Host info: %s\n"$maxdb->host_info);

/* 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 host information */
printf("Host info: %s\n"maxdb_get_host_info($link));

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

以上例程的输出类似于:

Host info: localhost

参见

相关文章
php ibm db2 函数 returns a string containing the sqlstate returned by the last connection attemptphp ibm db2 函数 returns the cursor type used by a statement resourcephp maxdb 函数 returns the default character set for the database connectionphp maxdb 函数 returns a string description of the last connect errorphp maxdb 函数 returns a string description of the last errorphp maxdb 函数 returns an array of resources representing the fields in a result setphp maxdb 函数 returns the maxdb client version as a stringphp maxdb 函数 returns a string representing the type of connection usedphp maxdb 函数 returns the version of the maxdb protocol usedphp maxdb 函数 returns the auto generated id used in the last queryphp maxdb 函数 pings a server connection or tries to reconnect if the connection has gone downphp maxdb 函数 escapes special characters in a string for use in an sql statement taking into account the current charset of the connectionphp maxdb 函数 returns rpl query typephp maxdb 函数 returns a string description for last statement errorphp maxdb 函数 returns the thread id for the current connectionphp 多字节字符串 函数 returns position and length of a matched part of the multibyte regular expression for a predefined multibyte stringphp mysqlnd ms 函数 returns an array which describes the last used connectionphp rpm reader 函数 returns a string representing the current version of the rpmreader extensionphp zlib 函数 returns the coding type used for output compressionphp mysqlnduhconnection returns a string representing the type of connection used
关注编程学问公众号