Forum und email

maxdb_get_host_info

maxdb->get_host_info

(PECL maxdb:1.0-7.6.00.38)

maxdb->get_host_info — Retourne une chaîne représentant le typde de connexion utilisé

Description

Style procédural

string maxdb_get_host_info ( resource $link )

Style orienté objet (méthode)

maxdb
string$host_info;

maxdb_get_host_info() retourne une chaîne décrivant la connexion représentée par le paramètre link .

Valeurs de retour

Une chaîne représentant l'hôte du serveur ainsi que le type de connexion.

Exemples

Example#1 Style orienté objet

<?php
$maxdb 
= new maxdb("localhost""MONA""RED""DEMODB");

/* Vérification de la connexion */
if (maxdb_connect_errno()) {
    
printf("Echec de la connexion : %s\n"maxdb_connect_error());
    exit();
}

/* Affiche les informations de l'hôte */
printf("Informations sur l'hôte : %s\n"$maxdb->host_info);

/* Fermeture de la connexion */
$maxdb->close();
?>

Example#2 Style procédural

<?php
$link 
maxdb_connect("localhost""MONA""RED""DEMODB");

/* Vérification de la connexion */
if (maxdb_connect_errno()) {
    
printf("Echec de la connexion : %s\n"maxdb_connect_error());
    exit();
}

/* Affiche les informations de l'hôte */
printf("Informations sur l'hôte : %s\n"maxdb_get_host_info($link));

/* Fermeture de la connexion */
maxdb_close($link);
?>

L'exemple ci-dessus va afficher :

Informations sur l'hôte : localhost