aboutsummaryrefslogtreecommitdiff
path: root/lib/database.php
diff options
context:
space:
mode:
authorArno Richter <oelna@oelna.de>2022-12-13 23:28:38 +0100
committerArno Richter <oelna@oelna.de>2022-12-13 23:28:38 +0100
commit67b51e9f905c568444741eaad0eb5d82df7f09c8 (patch)
treeb7852e7d57e15a42f3dd752f891e8d513e3139a8 /lib/database.php
parent0399f48a1f6a5e7151e3539038662686ed365ca7 (diff)
downloadmicroblog-67b51e9f905c568444741eaad0eb5d82df7f09c8.tar.gz
microblog-67b51e9f905c568444741eaad0eb5d82df7f09c8.tar.bz2
microblog-67b51e9f905c568444741eaad0eb5d82df7f09c8.zip
make pagination more robust. add undelete method for posts, if you know the id.
Diffstat (limited to 'lib/database.php')
-rw-r--r--lib/database.php3
1 files changed, 3 insertions, 0 deletions
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();