add: einheitliche delete funktion
This commit is contained in:
parent
072744998c
commit
b8562a50e0
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user