prepare($sql); // Bind the driver_id parameter $stmt->bindParam(':driver_id', $driver_id, PDO::PARAM_STR); try { // Execute the query $stmt->execute(); if ($stmt->rowCount() > 0) { // Success response jsonSuccess(null, "Record(s) deleted successfully."); } else { // Failure response: no records found to delete jsonError("No records found for the provided driver ID."); } } catch (PDOException $e) { // Handle any SQL errors jsonError("Error deleting records: " . $e->getMessage()); } ?>