install.php 694 Bytes
<?php

class MyDB extends SQLite3
{
    function __construct()
    {
        $this->open('wiki.db');
    }
    
        
}

	$db = new MyDB();

    if(!$db) echo $db->lastErrorMsg();



    $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) NULL, text STRING NULL)');
    if(!$query) echo $db->lastErrorMsg();

    $query = $db->exec('CREATE TABLE sections (id INTEGER PRIMARY KEY AUTOINCREMENT, page_id INTEGER NULL, title VARCHAR (250) NULL, text STRING NULL )');
    if(!$query) echo $db->lastErrorMsg();

?>