<?php
include($_SERVER['DOCUMENT_ROOT'] . '/includes/include_all.inc.php');

if (isset($_GET['id'])) {
    $groupId = $_GET['id'];
    $stmt = $pdo->prepare("SELECT * FROM wp_groups WHERE id = ?");
    $stmt->execute([$groupId]);
    $group = $stmt->fetch(PDO::FETCH_ASSOC);
    
    if ($group) {
        echo json_encode($group);
    } else {
        echo json_encode(['error' => 'Group not found']);
    }
} else {
    echo json_encode(['error' => 'No group ID provided']);
}