Added function to deactivate post
This commit is contained in:
@@ -169,11 +169,13 @@ abstract class Model
|
||||
try {
|
||||
$db = static::connectDB();
|
||||
|
||||
$sql = "DELETE FROM {$table} WHERE id = ?";
|
||||
$sql = "UPDATE {$table} SET status = ? WHERE id = ?";
|
||||
|
||||
$query = $db->prepare($sql);
|
||||
$query->bindValue(1, 0);
|
||||
$query->bindValue(2, $id);
|
||||
|
||||
if ($query->execute([$id])) {
|
||||
if ($query->execute()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user