本文整理汇总了PHP中mysqli_get_proto_info函数的典型用法代码示例。如果您正苦于以下问题:PHP mysqli_get_proto_info函数的具体用法?PHP mysqli_get_proto_info怎么用?PHP mysqli_get_proto_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mysqli_get_proto_info函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dump_properties
function dump_properties($mysqli)
{
printf("\nClass variables:\n");
$variables = array_keys(get_class_vars(get_class($mysqli)));
sort($variables);
foreach ($variables as $k => $var) {
printf("%s = '%s'\n", $var, var_export(@$mysqli->{$var}, true));
}
printf("\nObject variables:\n");
$variables = array_keys(get_object_vars($mysqli));
foreach ($variables as $k => $var) {
printf("%s = '%s'\n", $var, var_export(@$mysqli->{$var}, true));
}
printf("\nMagic, magic properties:\n");
assert(@mysqli_affected_rows($mysqli) === @$mysqli->affected_rows);
printf("mysqli->affected_rows = '%s'/%s ('%s'/%s)\n", @$mysqli->affected_rows, gettype(@$mysqli->affected_rows), @mysqli_affected_rows($mysqli), gettype(@mysqli_affected_rows($mysqli)));
assert(@mysqli_get_client_info() === @$mysqli->client_info);
printf("mysqli->client_info = '%s'/%s ('%s'/%s)\n", @$mysqli->client_info, gettype(@$mysqli->client_info), @mysqli_get_client_info(), gettype(@mysqli_get_client_info()));
assert(@mysqli_get_client_version() === @$mysqli->client_version);
printf("mysqli->client_version = '%s'/%s ('%s'/%s)\n", @$mysqli->client_version, gettype(@$mysqli->client_version), @mysqli_get_client_version(), gettype(@mysqli_get_client_version()));
assert(@mysqli_errno($mysqli) === @$mysqli->errno);
printf("mysqli->errno = '%s'/%s ('%s'/%s)\n", @$mysqli->errno, gettype(@$mysqli->errno), @mysqli_errno($mysqli), gettype(@mysqli_errno($mysqli)));
assert(@mysqli_error($mysqli) === @$mysqli->error);
printf("mysqli->error = '%s'/%s ('%s'/%s)\n", @$mysqli->error, gettype(@$mysqli->error), @mysqli_error($mysqli), gettype(@mysqli_error($mysqli)));
assert(@mysqli_field_count($mysqli) === @$mysqli->field_count);
printf("mysqli->field_count = '%s'/%s ('%s'/%s)\n", @$mysqli->field_count, gettype(@$mysqli->field_count), @mysqli_field_count($mysqli), gettype(@mysqli_field_count($mysqli)));
assert(@mysqli_insert_id($mysqli) === @$mysqli->insert_id);
printf("mysqli->insert_id = '%s'/%s ('%s'/%s)\n", @$mysqli->insert_id, gettype(@$mysqli->insert_id), @mysqli_insert_id($mysqli), gettype(@mysqli_insert_id($mysqli)));
assert(@mysqli_sqlstate($mysqli) === @$mysqli->sqlstate);
printf("mysqli->sqlstate = '%s'/%s ('%s'/%s)\n", @$mysqli->sqlstate, gettype(@$mysqli->sqlstate), @mysqli_sqlstate($mysqli), gettype(@mysqli_sqlstate($mysqli)));
assert(@mysqli_get_host_info($mysqli) === @$mysqli->host_info);
printf("mysqli->host_info = '%s'/%s ('%s'/%s)\n", @$mysqli->host_info, gettype(@$mysqli->host_info), @mysqli_get_host_info($mysqli), gettype(@mysqli_get_host_info($mysqli)));
/* note that the data types are different */
assert(@mysqli_info($mysqli) == @$mysqli->info);
printf("mysqli->info = '%s'/%s ('%s'/%s)\n", @$mysqli->info, gettype(@$mysqli->info), @mysqli_info($mysqli), gettype(@mysqli_info($mysqli)));
assert(@mysqli_thread_id($mysqli) > @$mysqli->thread_id);
assert(gettype(@$mysqli->thread_id) == gettype(@mysqli_thread_id($mysqli)));
printf("mysqli->thread_id = '%s'/%s ('%s'/%s)\n", @$mysqli->thread_id, gettype(@$mysqli->thread_id), @mysqli_thread_id($mysqli), gettype(@mysqli_thread_id($mysqli)));
assert(@mysqli_get_proto_info($mysqli) === @$mysqli->protocol_version);
printf("mysqli->protocol_version = '%s'/%s ('%s'/%s)\n", @$mysqli->protocol_version, gettype(@$mysqli->protocol_version), @mysqli_get_proto_info($mysqli), gettype(@mysqli_get_proto_info($mysqli)));
assert(@mysqli_get_server_info($mysqli) === @$mysqli->server_info);
printf("mysqli->server_info = '%s'/%s ('%s'/%s)\n", @$mysqli->server_info, gettype(@$mysqli->server_info), @mysqli_get_server_info($mysqli), gettype(@mysqli_get_server_info($mysqli)));
assert(@mysqli_get_server_version($mysqli) === @$mysqli->server_version);
printf("mysqli->server_version = '%s'/%s ('%s'/%s)\n", @$mysqli->server_version, gettype(@$mysqli->server_version), @mysqli_get_server_version($mysqli), gettype(@mysqli_get_server_version($mysqli)));
assert(@mysqli_warning_count($mysqli) === @$mysqli->warning_count);
printf("mysqli->warning_count = '%s'/%s ('%s'/%s)\n", @$mysqli->warning_count, gettype(@$mysqli->warning_count), @mysqli_warning_count($mysqli), gettype(@mysqli_warning_count($mysqli)));
printf("\nAccess to undefined properties:\n");
printf("mysqli->unknown = '%s'\n", @$mysqli->unknown);
@($mysqli->unknown = 13);
printf("setting mysqli->unknown, @mysqli_unknown = '%s'\n", @$mysqli->unknown);
$unknown = 'friday';
@($mysqli->unknown = $unknown);
printf("setting mysqli->unknown, @mysqli_unknown = '%s'\n", @$mysqli->unknown);
printf("\nAccess hidden properties for MYSLQI_STATUS_INITIALIZED (TODO documentation):\n");
assert(@mysqli_connect_error() === @$mysqli->connect_error);
printf("mysqli->connect_error = '%s'/%s ('%s'/%s)\n", @$mysqli->connect_error, gettype(@$mysqli->connect_error), @mysqli_connect_error(), gettype(@mysqli_connect_error()));
assert(@mysqli_connect_errno() === @$mysqli->connect_errno);
printf("mysqli->connect_errno = '%s'/%s ('%s'/%s)\n", @$mysqli->connect_errno, gettype(@$mysqli->connect_errno), @mysqli_connect_errno(), gettype(@mysqli_connect_errno()));
}
示例2: printf
<?php
require_once "connect.inc";
if (!is_null($tmp = @mysqli_get_proto_info())) {
printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
}
if (!is_null($tmp = @mysqli_get_proto_info(NULL))) {
printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
}
require "table.inc";
if (!is_int($info = mysqli_get_proto_info($link)) || $info < 1) {
printf("[003] Expecting int/any_non_empty, got %s/%s\n", gettype($info), $info);
}
if (!is_null($tmp = @mysqli_get_proto_info('too many', 'arguments'))) {
printf("[004] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
}
print "done!";
示例3: mysql_server
public function mysql_server($num = '')
{
switch ($num) {
case 1:
return mysqli_get_server_info();
//MySQL 服务器信息
break;
case 2:
return mysqli_get_host_info();
//取得 MySQL 主机信息
break;
case 3:
return mysqli_get_client_info();
//取得 MySQL 客户端信息
break;
case 4:
return mysqli_get_proto_info();
//取得 MySQL 协议信息
break;
default:
return mysqli_get_client_info();
//默认取得mysql版本信息
}
}
示例4: mysql_get_proto_info
function mysql_get_proto_info($c = null)
{
if (($c = mysql_global_resource($c, 1 - func_num_args())) == null) {
return;
}
return mysqli_get_proto_info($c);
}
示例5: mysql_get_proto_info
function mysql_get_proto_info(\mysqli $link = null)
{
return mysqli_get_proto_info(\Dshafik\MySQL::getConnection($link));
}
示例6: my_mysqli_connect
<?php
require_once "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$pinfo = mysqli_get_proto_info($link);
var_dump($pinfo);
mysqli_close($link);
print "done!";
示例7: protoVers
function protoVers()
{
return @mysqli_get_proto_info($this->_conn);
}
示例8: getProtocolInfo
public function getProtocolInfo()
{
if ($this->usemysqli) {
return mysqli_get_proto_info($this->link);
} else {
return mysql_get_proto_info($this->link);
}
}
示例9: printf
<?php
require_once "connect.inc";
$test_table_name = 'test_mysqli_get_proto_info_table_1';
require "table.inc";
if (!is_int($info = mysqli_get_proto_info($link)) || $info < 1) {
printf("[003] Expecting int/any_non_empty, got %s/%s\n", gettype($info), $info);
}
print "done!";
示例10: assert
assert(mysqli_insert_id($link) === $mysqli->insert_id);
printf("mysqli->insert_id = '%s'/%s ('%s'/%s)\n", $mysqli->insert_id, gettype($mysqli->insert_id), mysqli_insert_id($link), gettype(mysqli_insert_id($link)));
assert(mysqli_sqlstate($link) === $mysqli->sqlstate);
printf("mysqli->sqlstate = '%s'/%s ('%s'/%s)\n", $mysqli->sqlstate, gettype($mysqli->sqlstate), mysqli_sqlstate($link), gettype(mysqli_sqlstate($link)));
assert(soundex(mysqli_stat($link)) == soundex($mysqli->stat));
printf("mysqli->stat = '%s'/%s ('%s'/%s)\n", $mysqli->stat, gettype($mysqli->stat), mysqli_stat($link), gettype(mysqli_stat($link)));
assert(mysqli_get_host_info($link) === $mysqli->host_info);
printf("mysqli->host_info = '%s'/%s ('%s'/%s)\n", $mysqli->host_info, gettype($mysqli->host_info), mysqli_get_host_info($link), gettype(mysqli_get_host_info($link)));
/* note that the data types are different */
assert(mysqli_info($link) == $mysqli->info);
printf("mysqli->info = '%s'/%s ('%s'/%s)\n", $mysqli->info, gettype($mysqli->info), mysqli_info($link), gettype(mysqli_info($link)));
assert(mysqli_thread_id($link) > $mysqli->thread_id);
assert(gettype($mysqli->thread_id) == gettype(mysqli_thread_id($link)));
printf("mysqli->thread_id = '%s'/%s ('%s'/%s)\n", $mysqli->thread_id, gettype($mysqli->thread_id), mysqli_thread_id($link), gettype(mysqli_thread_id($link)));
assert(mysqli_get_proto_info($link) === $mysqli->protocol_version);
printf("mysqli->protocol_version = '%s'/%s ('%s'/%s)\n", $mysqli->protocol_version, gettype($mysqli->protocol_version), mysqli_get_proto_info($link), gettype(mysqli_get_proto_info($link)));
assert(mysqli_get_server_info($link) === $mysqli->server_info);
printf("mysqli->server_info = '%s'/%s ('%s'/%s)\n", $mysqli->server_info, gettype($mysqli->server_info), mysqli_get_server_info($link), gettype(mysqli_get_server_info($link)));
assert(mysqli_get_server_version($link) === $mysqli->server_version);
printf("mysqli->server_version = '%s'/%s ('%s'/%s)\n", $mysqli->server_version, gettype($mysqli->server_version), mysqli_get_server_version($link), gettype(mysqli_get_server_version($link)));
assert(mysqli_warning_count($link) === $mysqli->warning_count);
printf("mysqli->warning_count = '%s'/%s ('%s'/%s)\n", $mysqli->warning_count, gettype($mysqli->warning_count), mysqli_warning_count($link), gettype(mysqli_warning_count($link)));
printf("\nAccess to undefined properties:\n");
printf("mysqli->unknown = '%s'\n", @$mysqli->unknown);
@($mysqli->unknown = 13);
printf("setting mysqli->unknown, mysqli_unknown = '%s'\n", @$mysqli->unknown);
$unknown = 'friday';
@($mysqli->unknown = $unknown);
printf("setting mysqli->unknown, mysqli_unknown = '%s'\n", @$mysqli->unknown);
$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
printf("\nAccess hidden properties for MYSLQI_STATUS_INITIALIZED (TODO documentation):\n");
示例11: mysql_compat_get_proto_info
function mysql_compat_get_proto_info($link = NULL)
{
if (!isset($link)) {
$link = $GLOBALS['mysql_compat_last_link'];
}
return mysqli_get_proto_info($link);
}
示例12: mysql_get_proto_info
function mysql_get_proto_info($link = NULL)
{
$link = mysql_resolve_link($link);
return mysqli_get_proto_info($link);
}
示例13: mysql_get_proto_info
function mysql_get_proto_info($link_identifier = null)
{
return mysqli_get_proto_info(mysql_ensure_link($link_identifier));
}
示例14: PMA_DBI_get_proto_info
/**
* Returns the version of the MySQL protocol used
* @uses mysqli_get_proto_info()
* @uses $GLOBALS['userlink'] as default for $link
* @param resource $link mysql link
* @return integer version of the MySQL protocol used
*/
function PMA_DBI_get_proto_info($link = null)
{
if (null === $link) {
if (isset($GLOBALS['userlink'])) {
$link = $GLOBALS['userlink'];
} else {
return false;
}
}
return mysqli_get_proto_info($link);
}
示例15: die
* @link http://www.dev4me.nl/
* @license http://www.gnu.org/licenses/gpl.html
* @platform WebsiteBaker 2.8.x
* @version 0.4.1
* @lastmodified August 23, 2016
*
*/
// Must include code to stop this file being access directly
if (defined('WB_PATH') == false) {
die("Cannot access this file directly");
}
if (is_object($database->DbHandle)) {
$title = "MySQLi Info";
$server_info = mysqli_get_server_info($database->DbHandle);
$host_info = mysqli_get_host_info($database->DbHandle);
$proto_info = mysqli_get_proto_info($database->DbHandle);
$client_info = mysqli_get_client_info($database->DbHandle);
$client_encoding = mysqli_character_set_name($database->DbHandle);
$status = explode(' ', mysqli_stat($database->DbHandle));
} else {
$title = "MySQL Info";
$server_info = mysql_get_server_info();
$host_info = mysql_get_host_info();
$proto_info = mysql_get_proto_info();
$client_info = mysql_get_client_info();
$client_encoding = mysql_client_encoding();
$status = explode(' ', mysql_stat());
}
$strictMode = $database->get_one('SELECT @@sql_mode');
$strict_info = (strpos($strictMode, 'STRICT_TRANS_TABLES') !== false or strpos($strictMode, 'STRICT_ALL_TABLES') !== false) ? "MySQL strict mode active" : "MySQL strict mode not active\n";
?>