php8.5
Home/ Manual/ pgsql / functions/ pg_connection_reset

pg_connection_reset

PHP function Edit on GitHub ✎

(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)

Reset connection (reconnect)

Description

pg_connection_reset(PgSql\Connection $connection): bool

pg_connection_reset() resets the connection. It is useful for error recovery.

Parameters

connection

Connection

Return Values

Success

Changelog

VersionDescription

Examples

pg_connection_reset() example

php
<?php
  $dbconn = pg_connect("dbname=publisher") or die("Could not connect");
  $dbconn2 = pg_connection_reset($dbconn);
  if ($dbconn2) {
      echo "reset successful\n";
  } else {
      echo "reset failed\n";
  }
?>

See Also

Source: reference/pgsql/functions/pg-connection-reset.xml · from the official PHP manual (php/doc-en)