summaryrefslogtreecommitdiff
path: root/html/db.php
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2022-07-15 21:29:16 +0200
committerErich Eckner <git@eckner.net>2022-07-15 21:29:16 +0200
commit8de8c576da92f6943e7ab5339b6286d3162b48d9 (patch)
treec3a897e964ca8683aa44dfce994eb6d9c4b4be5e /html/db.php
parent00c2358f7d8844942174199a132dab7804bdc48c (diff)
downloadcolocation-8de8c576da92f6943e7ab5339b6286d3162b48d9.tar.xz
Tagesendstand
Diffstat (limited to 'html/db.php')
-rw-r--r--html/db.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/html/db.php b/html/db.php
new file mode 100644
index 0000000..9f80d6b
--- /dev/null
+++ b/html/db.php
@@ -0,0 +1,34 @@
+<?php
+
+if (isset($db))
+ return;
+
+class MyDB extends SQLite3 {
+ function __construct() {
+ parent::__construct('/srv/http/vhosts/eckner.net/colocation.eckner.net/backend/sqlite.db');
+ }
+ function exec($query) {
+ $result = parent::exec($query);
+ if (!$result)
+ die();
+ return $result;
+ }
+ function query($query) {
+ $result = parent::query($query);
+ if (!$result)
+ die();
+ return $result;
+ }
+ function prepare($query) {
+ $result = parent::prepare($query);
+ if (!$result)
+ die();
+ return $result;
+ }
+}
+
+$db = new MyDB();
+if(!$db) {
+ echo $db->lastErrorMsg();
+ die();
+}