prepare($sql); $stmt->bindParam(':id', $id, PDO::PARAM_INT); $stmt->execute(); // Check the result and print the appropriate message if ($stmt->rowCount() > 0) { jsonSuccess(null, "Record with ID $id deleted successfully."); } else { jsonError("No record found with ID $id."); } } catch (PDOException $e) { jsonError("Database error: " . $e->getMessage()); } catch (Exception $e) { jsonError("Error: " . $e->getMessage()); } ?>