false, 'error' => 'Login required']); exit; } $comment_id = (int)($_POST['comment_id'] ?? 0); if (!$comment_id) { echo json_encode(['success' => false, 'error' => 'Invalid data']); exit; } try { $stmt = $pdo->prepare("UPDATE comments SET is_reported = TRUE WHERE id = ?"); $stmt->execute([$comment_id]); echo json_encode(['success' => true]); } catch (Exception $e) { echo json_encode(['success' => false, 'error' => 'DB error']); } ?>