🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
19 lines
586 B
PHP
19 lines
586 B
PHP
<?php
|
|
try {
|
|
if (!file_exists("../lib/mydb.php")) {
|
|
throw new Exception("Required library file ../lib/mydb.php not found.");
|
|
}
|
|
require_once("../lib/mydb.php");
|
|
|
|
$pdo = db_connect();
|
|
$schemaPath = __DIR__ . "/schema.sql";
|
|
if (!file_exists($schemaPath)) {
|
|
throw new Exception("schema.sql file not found at: " . $schemaPath);
|
|
}
|
|
$sql = file_get_contents($schemaPath);
|
|
$pdo->exec($sql);
|
|
echo "Table 'barobill_members' initialized successfully.";
|
|
} catch (Throwable $e) {
|
|
echo "Error: [" . get_class($e) . "] " . $e->getMessage();
|
|
}
|