View Full Version : Sorting Members By Most Active

03-01-2007, 12:15 PM
Hi all,

Am a complete newbie at ASP, I currently have a site which has a MySQL backend database, users can apply to join and then once joined they can edit there information. I can login using a username/password senario. From there I can see all users currently active, and whom I am waiting to join... I can also search the users Birthdays that are coming up and delete users... Pretty straight forward. I want to be able to see the last 5 users who logged on? Anyone know how to do this or if it's fairly complicated?

03-01-2007, 12:31 PM
If you just looking for a mechanism using which you want to just display/find out the last 5 logged users then I think it can be done through application level variables (using Application object).

1. Have 5 application level variables.

2. whenever a user logs in put his user name in the first application variable

3. when a second user logs in then the first one will be put into the second application variable and the second user in the first application variable.

Like this you can always keep track of your last logged 5 users. You need to do these processing in Session_OnStart.

Then you can just print the application level variable values whereever you want.