From f9e3c0c1c79765972536c46a4f02874d597fc340 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sat, 9 Jul 2022 02:10:31 +0000 Subject: [PATCH] PHP8.1 Compatability restore error handling to previous state whilst using this package --- DB/mysqli.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/DB/mysqli.php b/DB/mysqli.php index 3867112..3c34688 100644 --- a/DB/mysqli.php +++ b/DB/mysqli.php @@ -296,7 +296,10 @@ function connect($dsn, $persistent = false) $ini = ini_get('track_errors'); @ini_set('track_errors', 1); $php_errormsg = ''; - + if (version_compare(PHP_VERSION, '8.1', '>=')) + { + mysqli_report(MYSQLI_REPORT_OFF); + } if (((int) $this->getOption('ssl')) === 1) { $init = mysqli_init(); mysqli_ssl_set( @@ -362,6 +365,10 @@ function disconnect() { $ret = @mysqli_close($this->connection); $this->connection = null; + if (version_compare(PHP_VERSION, '8.1', '>=')) + { + mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); + } return $ret; }