From f149330f150bc0f2375f71d9ad871cf917b530d3 Mon Sep 17 00:00:00 2001 From: hubaishan Date: Tue, 2 Feb 2021 07:28:34 +0300 Subject: [PATCH] [PHP8, postgreSQL] Fix fatal error The error is: Fatal error: Uncaught TypeError: pg_connect(): Argument #2 ($flags) must be of type int, bool given in ezsql\ezsql\lib\Database\ez_pgsql.php:106 --- lib/Database/ez_pgsql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Database/ez_pgsql.php b/lib/Database/ez_pgsql.php index 34da6eb..4f56e16 100644 --- a/lib/Database/ez_pgsql.php +++ b/lib/Database/ez_pgsql.php @@ -103,7 +103,7 @@ public function connect( $connect_string = "host=" . $host . " port=" . $port . " dbname=" . $name . " user=" . $user . " password=" . $password; // Try to establish the server database handle - if (!$this->dbh = \pg_connect($connect_string, true)) { + if (!$this->dbh = \pg_connect($connect_string, PGSQL_CONNECT_FORCE_NEW)) { $this->register_error(\FAILED_CONNECTION . ' in ' . __FILE__ . ' on line ' . __LINE__); } else { $this->_connected = true;