PG_CLOSE(3)															       PG_CLOSE(3)

pg_close - Closes a PostgreSQL connection

bool pg_close ([resource $connection]) DESCRIPTION
pg_close(3) closes the non-persistent connection to a PostgreSQL database associated with the given $connection resource. Note Using pg_close(3) is not usually necessary, as non-persistent open connections are automatically closed at the end of the script. If there is open large object resource on the connection, do not close the connection before closing all large object resources. PARAMETERS
o $connection - PostgreSQL database connection resource. When $connection is not present, the default connection is used. The default connection is the last connection made by pg_connect(3) or pg_pconnect(3). RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 pg_close(3) example <?php $dbconn = pg_connect("host=localhost port=5432 dbname=mary") or die("Could not connect"); echo "Connected successfully"; pg_close($dbconn); ?> The above example will output: Connected successfully SEE ALSO
pg_connect(3). PHP Documentation Group PG_CLOSE(3)

Featured Tech Videos