aboutsummaryrefslogtreecommitdiff
path: root/lib/database.php
diff options
context:
space:
mode:
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();