install.php 773 Bytes
<?php

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

    public function escape($data) {
        if(is_array($data))
            return array_map("sqlite_escape_string", $data);

        return sqlite_escape_string($data);
    }
    
        
}

	$db = new MyDB();

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


    $query = $db->exec('CREATE TABLE pages (id INTEGER PRIMARY KEY AUTOINCREMENT, title varchar(250) NULL, text TEXT NULL, plain_text TEXT 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 TEXT NULL, plain_text TEXT NULL )');
    if(!$query) echo $db->lastErrorMsg();

?>