shaunrigby Posted April 24, 2007 Share Posted April 24, 2007 do you both have an IRC client such as mIRC? Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237553 Share on other sites More sharing options...
MadTechie Posted April 24, 2007 Share Posted April 24, 2007 na, would be easier if i did Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237554 Share on other sites More sharing options...
shaunrigby Posted April 24, 2007 Share Posted April 24, 2007 dload it mirc.com  Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237555 Share on other sites More sharing options...
alohatofu Posted April 24, 2007 Author Share Posted April 24, 2007 this is so much easier working directly  ok updated (again)  <?php $id = $_SESSION['tznUserId']; $time=time(); $timeout=time()+(60*60); #now+1hour mysql_query("UPDATE `surv_member` SET timestamp='$timeout' WHERE memberId='$id' LIMIT 1"); $query=mysql_query("SELECT * FROM `surv_member` WHERE `timestamp`>='$time'") or die(mysql_error()); $display = array(); while($row=mysql_fetch_array($query)) { $display[] = $row['username']; } //spit out the results mysql_close(); foreach($display as $d) { print "$d<br />"; } ?>   Still did not output any message =/  btw. I appreciate it Shaun and TEchie Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237556 Share on other sites More sharing options...
alohatofu Posted April 24, 2007 Author Share Posted April 24, 2007 do you both have an IRC client such as mIRC? Â I have GAIM which can handle irc Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237558 Share on other sites More sharing options...
shaunrigby Posted April 25, 2007 Share Posted April 25, 2007 join #php-coding on irc.freenode.net Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237559 Share on other sites More sharing options...
shaunrigby Posted April 25, 2007 Share Posted April 25, 2007 madtech u dloadin mIRC? Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237560 Share on other sites More sharing options...
MadTechie Posted April 25, 2007 Share Posted April 25, 2007 ok  na don't use mIRC or any IRc's  <?php $id = $_SESSION['tznUserId']; mysql_query("UPDATE `surv_member` SET timestamp=NOW() WHERE memberId='$id' LIMIT 1"); $query=mysql_query("SELECT * FROM `surv_member` WHERE (`timestamp`+60*60) >= NOW()") or die(mysql_error()); $display = array(); while($row=mysql_fetch_array($query)) { $display[] = $row['username']; } //spit out the results mysql_close(); foreach($display as $d) { print "$d<br />"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237572 Share on other sites More sharing options...
alohatofu Posted April 25, 2007 Author Share Posted April 25, 2007 Holy crap!! Â Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237578 Share on other sites More sharing options...
shaunrigby Posted April 25, 2007 Share Posted April 25, 2007 After all of that lol, please rem,ember to set your thread as resolved, Â TA Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237580 Share on other sites More sharing options...
alohatofu Posted April 25, 2007 Author Share Posted April 25, 2007 Thank you so much guys!! AWSOME! it's like magic Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237583 Share on other sites More sharing options...
MadTechie Posted April 25, 2007 Share Posted April 25, 2007 i had to re-work the dates, they can be a pain sometimes Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237584 Share on other sites More sharing options...
MadTechie Posted April 25, 2007 Share Posted April 25, 2007 ok 1:21am i'm out night i hope its truly working. Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237588 Share on other sites More sharing options...
alohatofu Posted April 25, 2007 Author Share Posted April 25, 2007 yes it's working!!! Â btw, I don't need the online and timestamp column righgt? Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237590 Share on other sites More sharing options...
alohatofu Posted April 25, 2007 Author Share Posted April 25, 2007 Ok, when I logged out it's still showing my username  =/ Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237593 Share on other sites More sharing options...
MadTechie Posted April 25, 2007 Share Posted April 25, 2007 correct, Â runs by time alone if they are inactive for an hour then they are off the list, Â $query=mysql_query("SELECT * FROM `surv_member` WHERE (`timestamp`+60*60) >=Â NOW()") or die(mysql_error()); Â change (`timestamp`+60*60) to (`timestamp`+30*60) for 30 minutes etc Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237596 Share on other sites More sharing options...
alohatofu Posted April 25, 2007 Author Share Posted April 25, 2007 cool. that will work. thanks Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237597 Share on other sites More sharing options...
MadTechie Posted April 25, 2007 Share Posted April 25, 2007 Oh this is used for active members for in the last hour,  if you want then to be removed from the list on logout add this to the logout  $id = $_SESSION['tznUserId']; mysql_query("UPDATE `surv_member` SET timestamp=NOW() WHERE memberId='$id' LIMIT 1");   Oh this would work better <?php $query=mysql_query("SELECT * FROM `surv_member` WHERE `timestamp` <= (NOW()-60*60)") or die(mysql_error()); ?>    OK well i am drained, i need sleep, catch ya later Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237602 Share on other sites More sharing options...
otuatail Posted April 25, 2007 Share Posted April 25, 2007 this means then that you have not got a field in your table surv_member called 'timestamp' don't forget case sensitive. In phpmyadmin there is an export button on the top click this and click the bottom button Go. You will have the text for creating the database table. show it to us. Â Desmond. Â Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-238037 Share on other sites More sharing options...
alohatofu Posted April 25, 2007 Author Share Posted April 25, 2007 This issue is resolved thanks Quote Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-238043 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.