From 3f82c916ea04fd41310725e4e15f1e9ee148587a Mon Sep 17 00:00:00 2001 From: Kilian Kurt Hofmann Date: Fri, 26 Apr 2024 11:21:08 +0200 Subject: [PATCH] Initial Commit --- configs/.htaccess | 2 ++ configs/database.php | 15 +++++++++++++++ configs/db.ini | 5 +++++ configs/index.php | 16 ++++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 configs/.htaccess create mode 100644 configs/database.php create mode 100644 configs/db.ini create mode 100644 configs/index.php diff --git a/configs/.htaccess b/configs/.htaccess new file mode 100644 index 0000000..54aa684 --- /dev/null +++ b/configs/.htaccess @@ -0,0 +1,2 @@ +DENY FROM ALL +ALLOW FROM 127.0.0.1 \ No newline at end of file diff --git a/configs/database.php b/configs/database.php new file mode 100644 index 0000000..27b07e0 --- /dev/null +++ b/configs/database.php @@ -0,0 +1,15 @@ + false)); + + $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); + + return $db; +} +?> diff --git a/configs/db.ini b/configs/db.ini new file mode 100644 index 0000000..788d249 --- /dev/null +++ b/configs/db.ini @@ -0,0 +1,5 @@ +[ZEDAT] +host = usersql.zedat.fu-berlin.de +user = khofmann-sql +passwd = xz8c7m7p +database = khofmann-db1 diff --git a/configs/index.php b/configs/index.php new file mode 100644 index 0000000..4eb81e8 --- /dev/null +++ b/configs/index.php @@ -0,0 +1,16 @@ +prepare($query); +$stmt->execute(); +$result = $stmt->fetch(PDO::FETCH_ASSOC); + +echo json_encode($result); +?> \ No newline at end of file