downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

maxdb_master_query> <maxdb_insert_id
Last updated: Fri, 14 Aug 2009

view this page in

maxdb_kill

maxdb->kill

(PECL maxdb >= 1.0)

maxdb_kill -- maxdb->killDéconnecte un serveur MaxDB

Description

Style procédural :

bool maxdb_kill ( resource $link , int $processid )

Style orienté objet (méthode) :

maxdb
bool kill ( int $processid )

Cette fonction est utilisée pour se déconnecter d'un serveur MaxDB spécifié par le paramètre processid .

Valeurs de retour

Cette fonction retourne TRUE en cas de succès, FALSE en cas d'échec.

Exemples

Exemple #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();
}

/* Détermine l'identifiant du thread */
$thread_id $maxdb->thread_id;

/* Tue la connexion */
$maxdb->kill($thread_id);

/* Ceci doit produire une erreur */
if (!$maxdb->query("CREATE TABLE myCity LIKE City")) {
    
printf("Erreur : %s\n"$maxdb->error);
    exit;
}

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

Exemple #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();
}

/* Détermine l'identifiant du thread */
$thread_id maxdb_thread_id($link);

/* Tue la connexion */
maxdb_kill($link$thread_id);

/* Ceci doit produire une erreur */
if (!maxdb_query($link"CREATE TABLE myCity LIKE City")) {
    
printf("Erreur : %s\n"maxdb_error($link));
    exit;
}

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

L'exemple ci-dessus va afficher quelque chose de similaire à :

Erreur : Session not connected

Voir aussi



add a note add a note User Contributed Notes
maxdb_kill
There are no user contributed notes for this page.

maxdb_master_query> <maxdb_insert_id
Last updated: Fri, 14 Aug 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites