PHP Dokumentation: Function pg-connection-status
12. Januar 2010 von werner
pg_connection_status
(PHP 4 >= 4.2.0, PHP 5)
pg_connection_status — Gibt den Verbindungsstatus zurück
Beschreibung
pg_connection_status() gibt den Status der angegebenen connection zurück.
Parameter-Liste
- connection
PostgreSQL Verbindungskennung.
Rückgabewerte
PGSQL_CONNECTION_OK oder PGSQL_CONNECTION_BAD.
Beispiele
Beispiel #1 pg_connection_status() Beispiel
<?php
$dbconn = pg_connect("dbname=publisher") or die("Konnte keine Verbindung aufbauen");
$stat = pg_connection_status($dbconn);
if ($stat === PGSQL_CONNECTION_OK) {
echo 'Verbindungsstatus ok';
} else {
echo 'Verbindungsstatus bad';
}
?>Siehe auch
- pg_connection_busy() – Gibt den Status der Verbindung zurück (busy/not busy)