PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of Paul C   PersistentObject   test.php   Download  
File: test.php
Role: Unit test script
Content type: text/plain
Description: Demo
Class: PersistentObject
Encapsulates a database table row in a class
Author: By
Last change:
Date: 21 years ago
Size: 767 bytes
 

Contents

Class file image Download
<html>
<head>
    <title>PersistentObject Testpad</title>
</head>
<body>

<?php
/**
  * @Author: Paul Campbell <paul@campbell-multimedia.com>
  * @Company: Campbell Multimedia <www.campbell-multimedia.com>
  * @Date: 2nd July 2003
  */

require_once( "config.php" );
$c = new CustomerPlain();
$c->load( $db, 1 );
print
"<p>Just a load...</p>";
$c->render($db);

$c->set( "name", "Different Name" );
$c->commit($db);
$c->load( $db, 1 );

print
"<p>After modification, commit() and load()</p>";
$c->render();

$c = new CustomerPlain();
$c->create("NewCustomer");

$c->commit($db);
$c->load( $db , $c->id );
print
"<p>A new customer, inserted into the DB as a new row, loaded and rendered.</p>";
print
"<p>New CustomerID = $c->id</p>";
$c->render();


?><br /><?



?>