diff --git a/Controller/EnthaeltController.php b/Controller/EnthaeltController.php index 65bf83f..7739b5d 100644 --- a/Controller/EnthaeltController.php +++ b/Controller/EnthaeltController.php @@ -16,5 +16,10 @@ $result=$this->db->insertEnthaelt($data); return json_encode($result); } + + public function deleteEnthaelt($id){ + $result=$this->db->deleteEnthaelt($id); + return json_encode($result); + } } ?> \ No newline at end of file diff --git a/Model/EnthaeltModel.php b/Model/EnthaeltModel.php index e296e43..a00546d 100644 --- a/Model/EnthaeltModel.php +++ b/Model/EnthaeltModel.php @@ -48,5 +48,20 @@ return false; } } + + public function deleteEnthaelt($id){ + $pdo=$this->linkDB(); + $params = array(); + $sql = "DELETE FROM Enthaelt WHERE id=:id"; + $params[":id"] = $id; + try{ + $stmt = $pdo->prepare($sql); + $stmt->execute($params); + return true; + } + catch(\PDOExeption $e){ + return false; + } + } } ?> \ No newline at end of file