From 1b08e302c0a54fdc53c721cc5720134408e42f62 Mon Sep 17 00:00:00 2001 From: laotoutou Date: Sun, 31 Dec 2023 13:32:41 +0800 Subject: [PATCH] bugfix: $dbname is not used in driver_pgsql.php --- pg4wp/driver_pgsql.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pg4wp/driver_pgsql.php b/pg4wp/driver_pgsql.php index 51bfabd..ee39f81 100644 --- a/pg4wp/driver_pgsql.php +++ b/pg4wp/driver_pgsql.php @@ -101,7 +101,7 @@ function wpsqli_real_connect(&$connection, $hostname = null, $username = null, $ // Must connect to a specific database unlike MySQL $dbname = defined('DB_NAME') && DB_NAME ? DB_NAME : $database; - $pg_connstr = $GLOBALS['pg4wp_connstr'] . ' dbname=' . $database; + $pg_connstr = $GLOBALS['pg4wp_connstr'] . ' dbname=' . $dbname; $GLOBALS['pg4wp_conn'] = $connection = pg_connect($pg_connstr); return $connection; @@ -1271,4 +1271,4 @@ function wpsqli_reap_async_query(&$connection) throw new \Exception("PG4WP: Not Yet Implemented"); // mysqli_reap_async_query => No direct equivalent in PostgreSQL. // Asynchronous queries can be executed in PostgreSQL using pg_send_query and retrieved using pg_get_result. -} \ No newline at end of file +}