install.php
709 Bytes
<?php
class MyDB extends SQLite3
{
function __construct()
{
$this->open('wiki.db');
}
}
$db = new MyDB();
if(!$db) echo $db->lastErrorMsg();
$pass = md5('initpass');
$query = $db->exec('CREATE TABLE admin (username varchar(255), password varchar(255))');
if(!$query) echo $db->lastErrorMsg();
$query = $db->exec('CREATE TABLE pages (id INTEGER PRIMARY KEY AUTOINCREMENT, title varchar(250), text string, sections integer)');
if(!$query) echo $db->lastErrorMsg();
$query = $db->exec('CREATE TABLE sections (id INTEGER PRIMARY KEY AUTOINCREMENT, page_id INTEGER, title varchar(250), text string)');
if(!$query) echo $db->lastErrorMsg();
?>