Browse code

search.php: 'temp' error suppression workaround for MySQL error message taking over the Search Results header for a failed penname search

Clarissa Walker authored on 2026/09/11 17:39:36
Showing 1 changed files
... ...
@@ -21,6 +21,18 @@
21 21
 // To read the license please visit http://www.gnu.org/copyleft/gpl.html
22 22
 // ----------------------------------------------------------------------
23 23
 
24
+// 'temp' error suppression for MySQL/MariaDB behavior in PHP 8 starting with 8.1
25
+//
26
+// script works right to an extent, but...
27
+// mysqli STRICT enabled - shows a MYSQL error message in place of the Search Results header (not ideal)
28
+// mysqli STRICT disabled - brings up a PHP warning regarding accessing num_rows on false in another script
29
+//
30
+// this only affects searching a penname that is confirmed not to exist
31
+
32
+ini_set('display_errors', 0);
33
+ini_set('display_startup_errors', 0);
34
+error_reporting(0);
35
+mysqli_report(MYSQLI_REPORT_OFF);
24 36
 
25 37
 // Page Setup
26 38
 // Set the current page id.  Because search does multiple things there are multiple possibilities