Sindbad~EG File Manager
<?php
// initDatabase.php
// This script creates (or updates) the SQLite database with the required tables.
$dbFile = 'ThreeBodyDatabase.db';
$db = new SQLite3($dbFile);
// Create the documents table.
$db->exec("
CREATE TABLE IF NOT EXISTS documents (
DocumentNumber INTEGER PRIMARY KEY AUTOINCREMENT,
nbodies INTEGER NOT NULL,
remark VARCHAR(128),
png_filename TEXT,
tmax INTEGER,
date_created TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
");
// Create the bodies table.
$db->exec("
CREATE TABLE IF NOT EXISTS bodies (
BodyNumber INTEGER PRIMARY KEY AUTOINCREMENT,
DocumentNumber INTEGER NOT NULL,
mass REAL NOT NULL,
color TEXT NOT NULL,
r REAL NOT NULL,
x0 REAL NOT NULL,
y0 REAL NOT NULL,
p0 REAL NOT NULL,
q0 REAL NOT NULL,
FOREIGN KEY(DocumentNumber) REFERENCES documents(DocumentNumber)
);
");
echo "Database initialized successfully.";
?>
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists