Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Mar 2006
    Posts
    459
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Adding Date/Time User Logs Into Site...

    Hi all,
    I want to be able to sort my users by the top 5 most active... Or the last 5 users to logon... I have added a DATETIME column to my MySQL members table... Just not sure what I now put on the home.php file, so it records the DATETIME into the table automatically... Any help would be greatly appreciated!

  • #2
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    For top 5 active, you'd have to define active. I'd advise against updating the database for every pageview. For instance, if it is a forum you could record when they last replied or posted a new topic. Then use that as the top 5 active.

    For last 5 logons, just update the datetime column upon login.

    Then query the database ordering by the datetime.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •