7 Replies - 3285 Views - Last Post: 29 March 2010 - 07:14 PM Rate Topic: -----

#1 Kamron3   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 25-December 09

Total Users Online + What Users Are Online

Posted 23 March 2010 - 03:21 PM

I'm trying to figure out how to create a successful code that pulls all the current users that are logged in and posts them in order from 0-9, A-Z AND also calculates how many users are currently online. If anyone would be as kind as to point me in the right direction, as it would be very appreciated.

Kamron3

This post has been edited by Kamron3: 23 March 2010 - 03:22 PM

Is This A Good Question/Topic? 0
  • +

Replies To: Total Users Online + What Users Are Online

#2 eddiehm   User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 78
  • Joined: 09-March 10

Re: Total Users Online + What Users Are Online

Posted 23 March 2010 - 03:27 PM

This really isn't too hard if you think about it. Take a swing at it then post what you have. After that I'll give you some more hints. But the best thing to do is just take a swing at it try the logic out then go from there.
Was This Post Helpful? 0
  • +
  • -

#3 Guest_grimpirate*


Reputation:

Re: Total Users Online + What Users Are Online

Posted 23 March 2010 - 04:53 PM

Pretty sure that if you search the tutorials and/or snippets you'll find something there along these lines.
Was This Post Helpful? 0

#4 Kamron3   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 25-December 09

Re: Total Users Online + What Users Are Online

Posted 23 March 2010 - 07:48 PM

I think it has something to do with setting a MySQL database for "online = 1" when a user's session is valid. Then a PHP script will go thru the row of all users with the online equivilent to one and display that onto the page...

But I do not know how to code that. I know what to do, just can't code it myself. Right now I have the login script that I got and I have it set the right variables and other things.

_k
Was This Post Helpful? 0
  • +
  • -

#5 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6824
  • View blog
  • Posts: 31,470
  • Joined: 10-May 07

Re: Total Users Online + What Users Are Online

Posted 23 March 2010 - 08:09 PM

Quote

But I do not know how to code that

I've used this tutorial for just this same purpose on a few sites.
Was This Post Helpful? 0
  • +
  • -

#6 Kamron3   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 25-December 09

Re: Total Users Online + What Users Are Online

Posted 27 March 2010 - 10:29 PM

This tutorial only shows the code for how many users are online. Not which users are online.

_k
Was This Post Helpful? 0
  • +
  • -

#7 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6824
  • View blog
  • Posts: 31,470
  • Joined: 10-May 07

Re: Total Users Online + What Users Are Online

Posted 27 March 2010 - 10:33 PM

It's a start. Tell me you can't return both the username & who's online from following that tutorial... it's really really simple.
Was This Post Helpful? 0
  • +
  • -

#8 Lochie   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 23
  • Joined: 07-February 10

Re: Total Users Online + What Users Are Online

Posted 29 March 2010 - 07:14 PM

View Postno2pencil, on 27 March 2010 - 09:33 PM, said:

It's a start. Tell me you can't return both the username & who's online from following that tutorial... it's really really simple.

Well, in case he CAN'T, here's the code. :P

$offline = time() - 600;
$query = mysql_query("SELECT * FROM users WHERE online >= $offline");
while($user = mysql_fetch_array($query)){
    echo($user['username']);
}


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1