mysql_get_host_info

(PHP 4 >= 4.0.5, PHP 5)

mysql_get_host_info — Get MySQL host info

Avviso

Questa estensione è stata deprecata in PHP 5.5.0 ed è stata rimossa in PHP 7.0.0. Al suo posto, si dovrebbe usare l'estensione MySQLi o PDO_MySQL. Vedere anche la guida MySQL: scelta dell'API. Le alternative a questa funzione includono:

Descrizione

function mysql_get_host_info(resource $link_identifier = NULL): string|false

Describes the type of connection in use for the connection, including the server host name.

Elenco dei parametri

link_identifier

La connessione MySQL. Se l'identificativo di connessione non è specificato, viene usata l'ultima connessione aperta da mysql_connect(). Se tale connessione non viene trovata, si cercherà di crearne una come se mysql_connect() fosse stata chiamata senza argomenti. Se nessuna connessione viene trovata o stabilita, viene generato un errore di livello E_WARNING.

Valori restituiti

Returns a string describing the type of MySQL connection in use for the connection o false in caso di fallimento.

Esempi

Example #1 mysql_get_host_info() example

<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
printf("MySQL host info: %s\n", mysql_get_host_info());
?>

Il precedente esempio visualizzerà qualcosa di simile a:

MySQL host info: Localhost via UNIX socket

Vedere anche:

User Contributed Notes

There are no user contributed notes for this page.
Adding new notes is disabled. Please see the links in the Found A Problem? section.
To Top