Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: $dbname is not used in driver_pgsql.php #88

Merged
merged 1 commit into from
Dec 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pg4wp/driver_pgsql.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
}
}