*I got nothing
Concurrent Users
Moderator: General Moderators
-
mmcoolkid94
- Forum Newbie
- Posts: 8
- Joined: Mon Jun 19, 2006 9:07 pm
Concurrent Users
Can anyone help me with a code to show how many users are on at once?
*I got nothing
*
*I got nothing
Last edited by mmcoolkid94 on Wed Jun 21, 2006 7:53 pm, edited 3 times in total.
Have a bit of included code on each page that updates a field in their row of the user table to show the time they were last active.
Then have something like
Hint: I like to use mktime() to get the epoch time, store that, and just use
Then have something like
Code: Select all
$time = $timenow - $five_minutes //or whateverCode: Select all
SELECT * FROM users WHERE active_date > $timeCode: Select all
$time = mktime() - 300; //five minutes ago- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
I think the word you want is 'Concurrent', not 'Congruent', though I could be mistaken.
To answer you question, when I set up my user table I uisually include a field for logged_in. This is used to support DB sessions for the user and can easily be adapted to check the count of users that are logged in...
To answer you question, when I set up my user table I uisually include a field for logged_in. This is used to support DB sessions for the user and can easily be adapted to check the count of users that are logged in...
Code: Select all
<?php
$sql = "SELECT COUNT(user_id) AS users_online FROM user_table WHERE user_logged_in = 1";
?>- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
You must mean concurrent users if so please change it in your title ...
is this something your looking for?: http://www.tutorialized.com/forum/viewtopic.php?t=46
if not how about: http://www.hotscripts.com/Detailed/23850.html
that page is a little confusing it trys to take you here:
http://www.ridwank.com/index.php?script=6 and you can download the script here: http://ridwank.host.sk/download/ preview it here: http://www.ridwank.com/script/whosonline/whosonline.php
i know your new, and not to be rude, but next time try googleing... php + what you want to look for before you post a message.

Chris
is this something your looking for?: http://www.tutorialized.com/forum/viewtopic.php?t=46
if not how about: http://www.hotscripts.com/Detailed/23850.html
that page is a little confusing it trys to take you here:
http://www.ridwank.com/index.php?script=6 and you can download the script here: http://ridwank.host.sk/download/ preview it here: http://www.ridwank.com/script/whosonline/whosonline.php
i know your new, and not to be rude, but next time try googleing... php + what you want to look for before you post a message.
Chris
-
mmcoolkid94
- Forum Newbie
- Posts: 8
- Joined: Mon Jun 19, 2006 9:07 pm
Is there a way so I can see where the Ip Adress is coming from like a map of the World with little dots of every Computer.
Last edited by mmcoolkid94 on Thu Jun 22, 2006 9:12 am, edited 2 times in total.
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
Hey,
http://webmonkey.wired.com/webmonkey/04 ... rogramming
Would be another tutorial I found that might be something like it. And try google maps API for the dot thing.
http://webmonkey.wired.com/webmonkey/04 ... rogramming
Would be another tutorial I found that might be something like it. And try google maps API for the dot thing.