first commit
This commit is contained in:
16
backend/ride/promo/delete.php
Normal file
16
backend/ride/promo/delete.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../../connect.php';
|
||||
|
||||
$id = filterRequest("id");
|
||||
|
||||
$sql = "DELETE FROM `promos` WHERE `id` = :id";
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindParam(':id', $id, PDO::PARAM_INT); // استخدام bindParam لحماية الاستعلام
|
||||
$stmt->execute();
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
jsonSuccess(null, "Promo data deleted successfully");
|
||||
} else {
|
||||
jsonError("Failed to delete promo data");
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user