Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Thomas Björk  >  memDB  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: A simple example of what this class can do
Class: memDB
Memory based database manager
Author: By
Last change: Minor changes
Date: 11 years ago
Size: 617 bytes
 

Contents

Class file image Download
<?php
include("memdb.php");
$m = new memDB();
$m->CreateTable("nisse");
$m->CreateTable("pelle");
$m->AddColumn("nisse""first"memColInt0);
$m->AddColumn("nisse""second"memColText"Pelle");
$m->AddRecord("nisse");
$m->SetField("nisse","first",5);
$m->SetFieldByIndex("nisse",1,10);
$m->AddRecord("nisse");
$m->SetField("nisse","first",10);
$m->SetFieldByIndex("nisse",1,"Hej");
echo 
"<PRE>";
$q $m->Query("nisse",array("second"=>"==\"Hej\""));
print_r($q);
$t = & $m->GetTable("pelle");
$t->AddColumn("x",memColInt,0);
print_r($m);
$m->Delete("nisse");
print_r($m);
echo 
"</PRE>";
?>