mysqli::$host_info

mysqli_get_host_info

(PHP 5, PHP 7, PHP 8)

mysqli::$host_info -- mysqli_get_host_infoDevuelve un string que contiene el tipo de conexión utilizada

Descripción

Estilo orientado a objetos

Estilo por procedimientos

mysqli_get_host_info(mysqli $mysql): string

mysqli_get_host_info() devuelve un string de caracteres que describe la conexión representada por el argumento mysql (incluyendo el nombre de host del servidor).

Parámetros

link

Sólo estilo por procediminetos: Un identificador de enlace devuelto por mysqli_connect() o mysqli_init()

Valores devueltos

Un string que representa el nombre de host del servidor y el tipo de conexión.

Ejemplos

Ejemplo #1 Ejemplo con $mysqli->host_info

Estilo orientado a objetos

<?php

mysqli_report
(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");

/* Muestra información sobre el host */
printf("Información sobre el host: %s\n", $mysqli->host_info);

Estilo por procedimientos

<?php

mysqli_report
(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$link = mysqli_connect("localhost", "my_user", "my_password", "world");

/* Muestra información sobre el host */
printf("Información sobre el host: %s\n", mysqli_get_host_info($link));

El resultado de los ejemplos sería:

Información sobre el host: Localhost via UNIX socket

Ver también

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top