From 5fba0fa53a712181df45fd65b1a03cfdefebeb8b Mon Sep 17 00:00:00 2001 From: structix Date: Thu, 4 Jul 2019 13:09:40 +0200 Subject: [PATCH] Update --- cgi-bin/uebung09/Database.php | 15 +++++++++ cgi-bin/uebung09/questions-edit.php | 49 +++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 cgi-bin/uebung09/questions-edit.php diff --git a/cgi-bin/uebung09/Database.php b/cgi-bin/uebung09/Database.php index 16478c5..527f51b 100644 --- a/cgi-bin/uebung09/Database.php +++ b/cgi-bin/uebung09/Database.php @@ -69,5 +69,20 @@ class Database return $resultArray; } + public function getQuestion($id) + { + $result = $this->connection->query("SELECT * FROM questions WHERE id = $id LIMIT 1"); + + $resultArray = []; + + while ($line = $result->fetch_assoc()) { + array_push($resultArray, $line); + } + + $result->free(); + + return $resultArray[0]; + } + } diff --git a/cgi-bin/uebung09/questions-edit.php b/cgi-bin/uebung09/questions-edit.php new file mode 100644 index 0000000..1331116 --- /dev/null +++ b/cgi-bin/uebung09/questions-edit.php @@ -0,0 +1,49 @@ +getQuestion($id); +$sol = $question['solution']; + +echo <<Frage bearbeiten
+ + +
+

+ + +
+END; + + echo('"); + +echo << +
+ + +
+END; + echo(''); + +echo << +
+ + +
+END; + echo('"); + +echo << +
+ + + +
+END; + +?>