Login   Register  
PHP Classes
elePHPant
Icontem

File: test1.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Pali  >  Textable  >  test1.php  >  Download  
File: test1.php
Role: Example script
Content type: text/plain
Description: Sample file
Class: Textable
Manage data in text files like database tables
Author: By
Last change: Updated file
Date: 2005-02-23 13:55
Size: 1,066 bytes
 

Contents

Class file image Download
<?php

function show_table($data){
    echo 
"<table border=\"1\">";
    foreach (
$data as $row){
        echo 
"<tr>";
        foreach (
$row as $field){
            echo 
"<td>".$field."</td>";
        }
        echo 
"</tr>";
    }
    echo 
"</table><br>";
}

include 
"textable.class.php";

$tb = new textable("data.dat");

//$tb->insert(array("Norman Mailer","nm@mailer.org","Nothing"));

//$tb->insert(array(array("Norman Mailer1","nm@mailer.org","Nothing"),
//                  array("Norman Mailer2","nm@mailer.org","Nothing"),
//                  array("Norman Mailer3","nm@mailer.org","Nothing")));

//$tb->update(array("J.D.Salinger"), array("","","Anything"));
//$tb->update(array("J.D.Salinger"), array("Norman Mailer","","Anything"));
//$tb->update(array("","","Nothing"), array("","","Anything"));

//$tb->delete(array("","","Nothing"));

//$tb->save();

//$lines = $tb->select(array("","","Nothing"));
//if ($lines){show_table($lines);}

show_table($tb->table);

if (
$tb->error == ""){$tb->error "No";}

show_table(array(array("Error:"$tb->error)))


?>