Skip to content

Commit 92f0f9b

Browse files
author
Nigel Jewell
committed
Suppress MySQLi errors so that MythWeb works with PHP 8.1.0.
1 parent e533158 commit 92f0f9b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

classes/Database/mysql.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ function __construct($db_name, $login, $password, $server='localhost', $port=NUL
5151
dl('mysql.so');
5252
}
5353
}
54+
55+
// Silence exceptions in PHP 8.1.0+
56+
mysqli_report(MYSQLI_REPORT_OFF);
57+
5458
// Connect to the database
5559
$this->dbh = @mysqli_connect($port ? "$server:$port" : $server, $login, $password)
5660
or $this->error("Can't connect to the database server.");

classes/Database/mysqlicompat.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ function __construct($db_name, $login, $password, $server='localhost', $port=NUL
5858
dl('mysql.so');
5959
}
6060
}
61+
62+
// Silence exceptions in PHP 8.1.0+
63+
mysqli_report(MYSQLI_REPORT_OFF);
64+
6165
// Connect to the database
6266
$this->dbh = @mysqli_connect($server, $login, $password, NULL, $port)
6367
or $this->error("Can't connect to the database server.");

0 commit comments

Comments
 (0)