From 55c9fe1c51b4397986009e9660cbad3c9c8cfc70 Mon Sep 17 00:00:00 2001 From: Avapox <138492506+Avapox@users.noreply.github.com> Date: Wed, 6 Dec 2023 08:57:17 +0100 Subject: [PATCH] Test --- Controller/istTeilController.php | 21 +++++++++++++++ Model/istTeilModel.php | 45 ++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 Controller/istTeilController.php create mode 100644 Model/istTeilModel.php diff --git a/Controller/istTeilController.php b/Controller/istTeilController.php new file mode 100644 index 0000000..3aece25 --- /dev/null +++ b/Controller/istTeilController.php @@ -0,0 +1,21 @@ + db = new istTeilModel(); + + } + + public function getBestellung(){ + $result = $this->db->getBestellung(); + + return json_encode($result); + } +} +?> diff --git a/Model/istTeilModel.php b/Model/istTeilModel.php new file mode 100644 index 0000000..7e93cd2 --- /dev/null +++ b/Model/istTeilModel.php @@ -0,0 +1,45 @@ + linkDB(); + + $sql = "SELECT bid FROM istTeil"; + + try { + $stmt = $pdo->prepare($sql); + }catch (\PDOException $e){ + //nur zum Testen: + //new Msg(true,null,$e); + //echo $e; + return false; + } + return $stmt->fetchAll(\PDO::FETCH_ASSOC); + } + + + public function InsertIstTeil($data){ + $pdo = $this -> linkDB(); + + $sql = "INSERT INTO istTeil(bid, gid)"; + + + + try { + $stmt = $pdo->prepare($sql); + }catch (\PDOException $e){ + //nur zum Testen: + //new Msg(true,null,$e); + //echo $e; + return false; + } + return $stmt->fetchAll(\PDO::FETCH_ASSOC); + } +} +?> \ No newline at end of file -- 2.39.5