From 20f0d7b9e9afa89f38c9478a4a734be7d2fd516d Mon Sep 17 00:00:00 2001 From: Matthew Bucci Date: Thu, 9 Nov 2023 20:19:02 -0800 Subject: [PATCH] driver fixes --- pg4wp/driver_pgsql.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pg4wp/driver_pgsql.php b/pg4wp/driver_pgsql.php index ce09846..6e52eb3 100644 --- a/pg4wp/driver_pgsql.php +++ b/pg4wp/driver_pgsql.php @@ -58,7 +58,7 @@ function wpsqli_init() * @param int $flags Client connection flags. * @return bool Returns TRUE on success or FALSE on failure. */ -function wpsqli_real_connect($connection, $hostname = null, $username = null, $password = null, $database = null, $port = null, $socket = null, $flags = 0) +function wpsqli_real_connect(&$connection, $hostname = null, $username = null, $password = null, $database = null, $port = null, $socket = null, $flags = 0) { $GLOBALS['pg4wp_connstr'] = ''; @@ -1190,7 +1190,7 @@ function wpsqli_real_escape_string($connection, $string) { // mysqli_real_escape_string => pg_escape_string (resource $connection, string $data): string // Escapes a string for safe use in database queries. - return pg_escape_string($connection, $data); + return pg_escape_string($connection, $string); } /** @@ -1250,9 +1250,9 @@ function wpsqli_errno($connection) */ function wpsqli_report($flags) { - throw new \Exception("PG4WP: Not Yet Implemented"); // mysqli_report => No direct equivalent in PostgreSQL. // MySQL's mysqli_report function is used to set what MySQLi should report, which doesn't have a direct equivalent in PostgreSQL's PHP functions. + return true; } /**