nomysqli.php - index



























































































































































<?php

/* this simulates most of the database functions that are in MYSQLI.PHP */

function dbstart() {
    global 
$db_table;

        
$arg getvar('arg');
        if (
$arg == ""$arg "root";
        
$db_table "import/$arg";

    
debug("dbstart $db_table");
}

function 
dberror() {

    return 
"dberror";
}

function 
dbtable() {
        global 
$db_table;

    return 
$db_table;
}

function 
dblistrecords($id NULL) {
    global 
$db_table;

    if (
$id)
        return 
is_file("$db_table/$id.txt");

    if (!
is_dir($db_table))
        return array(
'testing error');    // this will cause a really
                        //  weird error to happen!
    
$ids glob("$db_table/*.txt");
    
$ids str_replace("$db_table/","",$ids);
    
$ids str_replace(".txt","",$ids);
        
natsort($ids);
        return 
$ids;
}

function 
dbreadrecord($id) {
    global 
$db_table;
    
$rec = @file_get_contents("$db_table/$id.txt");
    if (!
$rec) return $rec;
        return 
arraytorecord($rec);
}

function 
dbgetrecord($id) {
    global 
$db_table;
    
$rec = @file_get_contents("$db_table/$id.txt");
    return 
$rec;
}

function 
dbnewrecord(/*mixed*/ $data) {

        return 
0;
}

function 
dbputrecord($id$data) {
    global 
$db_table;
    
$rec file_put_contents("$db_table/$id.txt",$data);
    return 
$rec;
}

function 
dbdelrecord($id) {

        return 
0;
}

function 
dblistcomments($entryid) {
    global 
$db_table;

    if (!
is_dir("$db_table/comments"))
        return array();

    
$ids glob("$db_table/comments/*.txt");
    
$ids str_replace("$db_table/comments/","",$ids);
    
$ids str_replace(".txt","",$ids);
        
natsort($ids);
        return 
$ids;
}

function 
dbreadcomment($id) {
    global 
$db_table;
    
$rec = @file_get_contents("$db_table/comments/$id.txt");
    if (!
$rec) return $rec;
        
$rec arraytorecord($rec);
        
$rec['id'] = $id;
        return 
$rec;
}

function 
dbwritecomment($entryid/*mixed*/ $record) {

    return 
0;
}

function 
dbputcomment($id$data) {

    return 
0;
}

function 
dbdelcomment($id) {

    return 
0;
}

function 
dbreaduser($userid) {

    return 
0;
}

function 
dbputuser($uid$record$update FALSE) {

        return 
0;
}

function 
dbvisitor($cmd$from NULL$data NULL) {

    return 
0;
}

function 
dbreadvisitor($from) {

    return 
0;
}

function 
dbnewvisitor($from$record) {

    return 
0;
}

function 
dbputvisitor($from$record) {

    return 
0;
}

function 
dbdelvisitor($from) {

    return 
0;
}

function 
dbrecord($cmd$data '') {

    return 
0;
}

function 
dbcomment($cmd$id$data '') {

    return 
0;
}

?>