add: einheitliche delete funktion

This commit is contained in:
Johannes Kantz 2022-12-21 11:03:37 +01:00
parent 072744998c
commit b8562a50e0

View File

@ -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;
}
}
}