PHP Portal » PHP Handbuch » pg_connection_status

Werbung

pg_connection_status


(PHP 4 >= 4.2.0, PHP 5)

pg_connection_status Gibt den Verbindungsstatus zurück

Beschreibung

int pg_connection_status ( resource $connection )

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

PHP Code
1
2
3
4
5
6
7
$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