Manuel PHP

pg_connection_status

(PHP 4 >= 4.2.0, PHP 5)

pg_connection_status Lit le statut de la connexion PostgreSQL

Description

int pg_connection_status ( resource $connection )

pg_connection_status() retourne le statut de la connexion connection .

Liste de paramètres

connection

Ressource de connexion de base de données PostgreSQL.

Valeurs de retour

PGSQL_CONNECTION_OK ou PGSQL_CONNECTION_BAD.

Exemples

Exemple #1 Exemple avec pg_connection_status()

  1. <?php
  2. $dbconn = pg_connect("dbname=publisher") or die("Connexion impossible");  
  3. $stat = pg_connection_status($dbconn);  
  4. if ($stat === PGSQL_CONNECTION_OK) { 
  5.    echo 'Connexion ok';  
  6. } else { 
  7.    echo 'Connexion erronée';  
  8. }  
  9. ?> 


Remonter Remonter
L'éditeur javascript - CSS - Gentoo - Tutoriaux PHP - Tutoriels PHP - Bretagne - php - Moto - Kit graphique