<?php
require_once 'db_connection.php';

try {
    $query = $pdo->query("SELECT id, name, description FROM themes");
    $themes = $query->fetchAll(PDO::FETCH_ASSOC);
    echo json_encode($themes);
} catch (PDOException $e) {
    error_log("Error fetching themes: " . $e->getMessage());
    echo json_encode([]);
}
?>
