i have question how to display users who are now on guestbook? and when they leave guestbook nick is deleted from online list of users in guestbook.
Что то типа этого
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `title_online`= 'guest' and `lastdate` > '" . ($realtime - 300) . "'"), 0)>0){
echo'<div class="list1">Кто в гостевой: ';
$onltime=$realtime-300;
$q=@mysql_query("select `id`, `name` from `users` where title_online = 'guest' and lastdate>='".intval($onltime)."' order by lastdate desc;");
while ($arr=mysql_fetch_array($q)) {
echo '<a href="'.$home.'/anketa/'.$arr['id'].'">'.$arr['name'].'</a>, ';
}
echo'</div>';}
@Macabre ill test it later
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.