<?

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();

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");
}

?>