diff --git a/cgi-bin/uebung09/Database.php b/cgi-bin/uebung09/Database.php index b4e8028..cd46739 100644 --- a/cgi-bin/uebung09/Database.php +++ b/cgi-bin/uebung09/Database.php @@ -47,15 +47,9 @@ class Database return $statement->execute(); } - /** - * Löscht den Taks mit der ID $id aus der Tabelle tasks - * - * @param int $id - * @return bool, falls Löschen erfolgreich - */ - public function deleteTask($id) + public function deleteQuestion($id) { - $statement = $this->connection->prepare("DELETE FROM tasks WHERE id = ?"); + $statement = $this->connection->prepare("DELETE FROM questions WHERE id = ?"); $statement->bind_param("i", $id); return $statement->execute(); } diff --git a/cgi-bin/uebung09/questions-delete.php b/cgi-bin/uebung09/questions-delete.php new file mode 100644 index 0000000..ae67539 --- /dev/null +++ b/cgi-bin/uebung09/questions-delete.php @@ -0,0 +1,14 @@ +deleteQuestion($id); + + +header("Location: questions-show.php"); + +?> diff --git a/cgi-bin/uebung09/questions-update.php b/cgi-bin/uebung09/questions-update.php index b6393b3..7df24ad 100644 --- a/cgi-bin/uebung09/questions-update.php +++ b/cgi-bin/uebung09/questions-update.php @@ -14,6 +14,6 @@ $db = new Database(); $db->updateQuestion($id, $question, $answer0, $answer1, $answer2, $solution); -//header("Location: questions-show.php"); +header("Location: questions-show.php"); ?>