Skip to content

Commit

Permalink
Suppress MySQLi errors so that MythWeb works with PHP 8.1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nigel Jewell committed Jun 4, 2022
1 parent e533158 commit 92f0f9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions classes/Database/mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ function __construct($db_name, $login, $password, $server='localhost', $port=NUL
dl('mysql.so');
}
}

// Silence exceptions in PHP 8.1.0+
mysqli_report(MYSQLI_REPORT_OFF);

// Connect to the database
$this->dbh = @mysqli_connect($port ? "$server:$port" : $server, $login, $password)
or $this->error("Can't connect to the database server.");
Expand Down
4 changes: 4 additions & 0 deletions classes/Database/mysqlicompat.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ function __construct($db_name, $login, $password, $server='localhost', $port=NUL
dl('mysql.so');
}
}

// Silence exceptions in PHP 8.1.0+
mysqli_report(MYSQLI_REPORT_OFF);

// Connect to the database
$this->dbh = @mysqli_connect($server, $login, $password, NULL, $port)
or $this->error("Can't connect to the database server.");
Expand Down

0 comments on commit 92f0f9b

Please sign in to comment.