From 67b51e9f905c568444741eaad0eb5d82df7f09c8 Mon Sep 17 00:00:00 2001 From: Arno Richter Date: Tue, 13 Dec 2022 23:28:38 +0100 Subject: make pagination more robust. add undelete method for posts, if you know the id. --- lib/database.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/database.php') diff --git a/lib/database.php b/lib/database.php index 0ffdb3a..5774d95 100644 --- a/lib/database.php +++ b/lib/database.php @@ -3,6 +3,9 @@ //connect or create the database try { $db = new PDO('sqlite:'.ROOT.DS.'posts.db'); + $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); + $config['db_version'] = $db->query("PRAGMA user_version")->fetch(PDO::FETCH_ASSOC)['user_version']; } catch(PDOException $e) { print 'Exception : '.$e->getMessage(); -- cgit v1.2.3