Files
skyview.astronomiemuseum.de/.codex-temp/check_meteor_table.php
T
2026-04-03 18:40:59 +02:00

12 lines
550 B
PHP

<?php
$config = require getcwd() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'database.php';
$dsn = sprintf('mysql:host=%s;dbname=%s;charset=%s', $config['host'], $config['dbname'], $config['charset'] ?? 'utf8mb4');
try {
$pdo = new PDO($dsn, $config['user'], $config['pass'], [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);
echo "CONNECTED\n";
$stmt = $pdo->query('SHOW TABLES LIKE "meteorshowers"');
var_export($stmt->fetchColumn()); echo "\n";
} catch (Throwable $e) {
echo get_class($e) . ': ' . $e->getMessage() . "\n";
}