first commit
This commit is contained in:
20
backend/ride/location/delete.php
Normal file
20
backend/ride/location/delete.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?
|
||||
|
||||
require_once __DIR__ . '/../../connect.php';
|
||||
|
||||
$driver_id = filterRequest("driver_id");
|
||||
|
||||
$sql = "DELETE FROM `car_locations` WHERE `driver_id` = :driver_id";
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->execute([':driver_id' => $driver_id]);
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
// Print a success message
|
||||
jsonSuccess($message = "Car location deleted successfully");
|
||||
} else {
|
||||
// Print a failure message
|
||||
jsonError($message = "Failed to delete car location");
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user