diff options
author | Andrey Andreev <narf@devilix.net> | 2021-12-20 15:40:18 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2021-12-20 15:40:18 +0100 |
commit | 4612cb74d037b705f3d987431354e87bb2551749 (patch) | |
tree | 2de3c35d5e3d895fd1b51baed87faeff6c0e15d6 | |
parent | a003ba25a58b5ddeae04225195b0aab1a5c29062 (diff) |
PHP 8.1 update to mysqli database driver
-rw-r--r-- | system/database/drivers/mysqli/mysqli_driver.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index c16897632..3dea1dbc5 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -116,6 +116,13 @@ class CI_DB_mysqli_driver extends CI_DB { */ public function db_connect($persistent = FALSE) { + // PHP 8.1 changes default error handling mode from silent to exceptions - reverse that + if (is_php('8.1')) + { + $mysqli_driver = new mysqli_driver(); + $mysqli_driver->report_mode = MYSQLI_REPORT_OFF; + } + // Do we have a socket path? if ($this->hostname[0] === '/') { |