Initial Commit
This commit is contained in:
commit
1d85bf6663
7 changed files with 377 additions and 0 deletions
20
admin/init_db.php
Normal file
20
admin/init_db.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
$db = new SQLite3(__DIR__ . '/../mentalnet_funnies.db');
|
||||
|
||||
// Check if the table already exists
|
||||
$result = $db->querySingle("SELECT name FROM sqlite_master WHERE type='table' AND name='comics'");
|
||||
|
||||
if ($result) {
|
||||
echo "ℹ️ Table 'comics' already exists.";
|
||||
} else {
|
||||
$db->exec("CREATE TABLE comics (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
title TEXT NOT NULL,
|
||||
filename TEXT NOT NULL,
|
||||
description TEXT,
|
||||
date_added DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
)");
|
||||
echo "✅ Table 'comics' created.";
|
||||
}
|
||||
?>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue