mysql_get_host_info

(PHP 4 >= 4.0.5, PHP 5)

mysql_get_host_infoGet MySQL host info

Avviso

Questa enstensione deprecata da PHP 5.5.0, e sarà rimossa in futuro. Al suo posto, usare l'estensione MySQLi o PDO_MySQL. Vedere anche la guida MySQL: scelta dell'API e le FAQ relative per ulteriori informazioni. Le alternative a questa funzione includono:

Descrizione

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, l'ultima connessione aperta da mysql_connect() viene assunta. Se questa connessione non è trovata, si cercherà di crearne una come se mysql_connect() fosse stata chiamata senza argomenti. Se una connessione non è trovata oppure non viene stabilita, un avviso di livello E_WARNING viene generato.

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 simile a:

MySQL host info: Localhost via UNIX socket

Vedere anche:

add a note add a note

User Contributed Notes

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