diff --git a/classes/Database.php b/classes/Database.php index 0b663a5..23d81c1 100644 --- a/classes/Database.php +++ b/classes/Database.php @@ -36,6 +36,11 @@ public function __construct($data) $this->db = new PDO("sqlite:".$this->data['path']); if($this->db!=NULL) { + if (version_compare(phpversion(), '8.0', '>=')) { + // Prior to PHP 8.0 this was the default, and we rely on it for error reporting + // See https://www.php.net/manual/en/pdo.error-handling.php + $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); + } $this->type = "PDO"; break; }