diff --git a/BancaDati/BancaDati.php b/BancaDati/BancaDati.php index 9701740..615b922 100644 --- a/BancaDati/BancaDati.php +++ b/BancaDati/BancaDati.php @@ -53,4 +53,21 @@ class BancaDati { die; } } + + /** + * Einheitliche Delete Funktion + * @param string $table + * @param string $id + * @return void + * @author Malte Schulze Hobeling + */ + public function delete(string $table, string $id){ + $sql = "DELETE FROM " . $table . " WHERE `id` = " . $id . ";"; + try { + $sth = $this->pdo->prepare($sql); + $sth->execute(); + }catch (\PDOException $e){ + die; + } + } } \ No newline at end of file