Hi
I've created a password protected Music Database. What I now need is, whenever a member logs in, the time and date of his login should be noted. I only need to record the last time he was logged in. Something like "You last logged in on 21st July, 2005 at 03:30." How do I go about it?

Also, I would like a counter to keep track of how many times in all the user has logged in. I'm guessing that this can be done by adding an Update query which will increment a counter field each time the user logs on. Is this the best way, or am I missing something here?

Thanks.

You can use database to store the last visited date, time and ip etc (save in the same database as user details). Everytime the user login, you query (SELECT) the database and display the last visited data bafore your UPDATE the database with current date, time, ip etc.

To know how many times a user has been loggin, use database is the best option to me. As in the above, your update the counter at the same time update the last visited details. If you are only interested on how many users (total users not individual) login to your system, then you may use a text file to count it.

.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.