Location: PHPKode > scripts > Textable > textable/test1.php
<?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","hide@address.com","Nothing"));

//$tb->insert(array(array("Norman Mailer1","hide@address.com","Nothing"),
//                  array("Norman Mailer2","hide@address.com","Nothing"),
//                  array("Norman Mailer3","hide@address.com","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)))


?>
Return current item: Textable