prepare("UPDATE material_donations SET status = 'approved' WHERE id = ?"); $stmt->bind_param("i", $donation_id); if ($stmt->execute()) { $_SESSION['success_message'] = "Donation approved successfully."; } else { $_SESSION['error_message'] = "Failed to approve the donation."; } $stmt->close(); } else { $_SESSION['error_message'] = "Invalid donation ID."; } header("Location: admin_dashboard.php"); exit; ?>