For a little modif it work for me. Thank You @Macabre.
If someone need it here code what work for me:
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `place`= 'guestbook' and `lastdate` > '" . ($realtime - 20) . "'"), 0)>0){
echo'<div class="list1">Who is on chat: ';
$onltime=$realtime-20;
$q=mysql_query("select `id`, `name` from `users` where `place` = 'guestbook' and lastdate>='".intval($onltime)."' order by lastdate desc;");
while ($arr=mysql_fetch_array($q))
{echo '<a href="../users/profile.php?user='.$arr['id'].'">'.$arr['name'].'</a>, ';}
echo'</div>';}So thread can be closed.