query($sql); $expired_files = $stmt->fetchAll(); foreach ($expired_files as $file) { $full_path = $_SERVER['DOCUMENT_ROOT'] . $file['audio_file_path']; // 파일 삭제 if (file_exists($full_path)) { unlink($full_path); } // DB 업데이트 (파일 경로는 지우고 기록은 남김) $update_sql = "UPDATE meeting_logs SET audio_file_path = NULL WHERE id = ?"; $pdo->prepare($update_sql)->execute([$file['id']]); echo "Deleted: " . $full_path . "\n"; } ?>