Here is one of about 1,000,000 ways to do it.
class account{
function account(){
$this->id = ' ';
$this->name = '';
$this->email = '';
}
function find_account(){
$sql="SELECT `id`,`name`,`email`,`timestamp` FROM `account` ORDER BY id DESC LIMIT 10";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result)){
foreach($row as $r => $v){
$return[][$r] = $v;
}
}
return $return;
}
}
<html>
<body>
<div>
<form action='?'>
name: <input type='text' name='account_name'>
email:<input type='text' id='account_email'>
<input type="button" value="submit">
</form>
</div>
<div style="border:solid 1px #F60;">
Last 10 entry:
</div>
<div style="border:solid 1px #000;">
<?php
$accounts = new account();
$lastten = $accounts->find_account();
for($i=0;$i<count($lastten);$i++){
echo $lastten[$i]['id'].' | '.$lastten[$i]['name'].' | '.$lastten[$i]['email'].'<br/>';
}
?>
</div>
</body>
</html>