<?php
// Include your database connection file
include('db_connection.php');

// Define today's date
$current_date = date('Y-m-d');

// SQL query to delete past activities
$sql = "DELETE FROM upcoming_activities WHERE activity_date < ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $current_date);
$stmt->execute();
$stmt->close();
$conn->close();

// Redirect back to admin dashboard or any appropriate page
header('Location: admin_dashboard.php');
exit();
?>
