Well it all depends on the scale of the application you are making. Also the type of information you are processing... check out this psedo class for a Contact record in php
class Contact {
var $firstName;
var $lastName;
var $phoneNumber;
function Contact ($id)
{
if ($id) {
//pull rest of information from DB
} else {
//do nothing
}
}
function create ($fName, $lName, $phone)
{
//insert into db values yadda yadda
// get insertid from result
return New Contact($result[insertid]);
}
function update ($nFName, $nLName, $nPhone)
{
//update where id=$this->id set values yadda yadda
}
function delete () {
//delete from db where id=$this->id
}
function display () {
$str .= '<b>'.$this->firstName.'</b>';
// however you want the html for each record
return $str;
}
}
now to work with this 'object' you just have to get a set of them.. ala a sql call such as
$sql = "SELECT id WHERE fName LIKE '%a%'"
$r = yourdb_query($sql);
while ($data = yourdb_fetch_row($r)) {
$record = New Contact($data[id]);
$record->display();
// or $record->delete()
// or whatever you want to do with the set
// of records
}
and to make a new record you just do a:
$me = Contact::create ("Jon", "Bardin", "123");
echo $me->display();
would echo <b>Jon</b>
now you can abstract you objects into meaningful methods and members so you can work with them in higher level ways
-Jon