This function closes the current database connection specified by a handle returned from a pg_connect() call.
<?php
$pgsql_conn = pg_connect("dbname=mark host=localhost");
if ($pgsql_conn) {
print "Successfully connected to: " . pg_host($pgsql_conn) . "<br/>\n";
} else {
print pg_last_error($pgsql_conn);
exit;
}
if(!pg_close($pgsql_conn)) {
print "Failed to close connection to " . pg_host($pgsql_conn) . ": " .
pg_last_error($pgsql_conn) . "<br/>\n";
} else {
print "Successfully disconnected from database";
}
?>
Of course you normally wouldn't print a message.
Regards, --mark