Skip to content

Commit f149330

Browse files
committed
[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
1 parent c843017 commit f149330

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/Database/ez_pgsql.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function connect(
103103
$connect_string = "host=" . $host . " port=" . $port . " dbname=" . $name . " user=" . $user . " password=" . $password;
104104

105105
// Try to establish the server database handle
106-
if (!$this->dbh = \pg_connect($connect_string, true)) {
106+
if (!$this->dbh = \pg_connect($connect_string, PGSQL_CONNECT_FORCE_NEW)) {
107107
$this->register_error(\FAILED_CONNECTION . ' in ' . __FILE__ . ' on line ' . __LINE__);
108108
} else {
109109
$this->_connected = true;

0 commit comments

Comments
 (0)