<?php
require_once 'config/database.php';

try {
    $stmt = $pdo->query('SELECT DISTINCT name FROM exams ORDER BY name');
    $names = $stmt->fetchAll();
    
    echo "Existing exam names:\n";
    foreach($names as $name) {
        echo "- " . $name['name'] . "\n";
    }
} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}
?>