<?
//get all users who have a lastaction within the last 5 minutes
$user = $dbh->prepare("select id,fullname from users where DATE_SUB(CURDATE(),INTERVAL 5 MINUTE) < lastaction and currpage = ?");
$user->bindValue(1,$page);
$user->execute();
while ($userrow = $user->fetch()){
$id = $userrow[0];
if (file_exists('userpics/'.$id.'.jpg')){
	echo '<img src = "thumbnail.php?pic=userpics/'.$id.'.jpg&ht=75&wd=75"/>';
}
echo $userrow[1].'<br/>';
	
}

?>