summaryrefslogtreecommitdiffstats
path: root/system/database/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers')
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php7
-rw-r--r--system/database/drivers/postgre/postgre_driver.php4
-rw-r--r--system/database/drivers/postgre/postgre_result.php2
3 files changed, 10 insertions, 3 deletions
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index 428b7e7f6..dc3d0cf48 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] === '/')
{
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php
index af636e3f5..22638f901 100644
--- a/system/database/drivers/postgre/postgre_driver.php
+++ b/system/database/drivers/postgre/postgre_driver.php
@@ -135,7 +135,7 @@ class CI_DB_postgre_driver extends CI_DB {
* Database connection
*
* @param bool $persistent
- * @return resource
+ * @return resource|object
*/
public function db_connect($persistent = FALSE)
{
@@ -220,7 +220,7 @@ class CI_DB_postgre_driver extends CI_DB {
* Execute the query
*
* @param string $sql an SQL query
- * @return resource
+ * @return resource|object
*/
protected function _execute($sql)
{
diff --git a/system/database/drivers/postgre/postgre_result.php b/system/database/drivers/postgre/postgre_result.php
index a0a628f0a..d977a60e3 100644
--- a/system/database/drivers/postgre/postgre_result.php
+++ b/system/database/drivers/postgre/postgre_result.php
@@ -126,7 +126,7 @@ class CI_DB_postgre_result extends CI_DB_result {
*/
public function free_result()
{
- if (is_resource($this->result_id))
+ if ($this->result_id !== FALSE)
{
pg_free_result($this->result_id);
$this->result_id = FALSE;