Change Data in Database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JonnySnip3rz
Forum Newbie
Posts: 4
Joined: Sat Apr 17, 2010 8:28 am

Change Data in Database

Post by JonnySnip3rz »

Hey guys was wondering if someone could help me, i didnt really know how to go about this hope someone could point me in the right direction. I have created a user login and it stores various information about the user: Name, Username, Email, Password, Date Joined, Is Active etc is there a script where when the admin logges in they will have a link to it maybe called UserActive.php (iknow how to do this haha) when the admin (me) navigates to this page it will show all the users in the database that have been inactive for a certain amount of time and then change IsActive back to a 0.

At the moment when a user registers to my site there account is created and there IsActive is set to 0 if they login then i test to see if its 0 if it is then tell them they have to activate their account via an email my site sends them So is there a way i could test to see if the user has logged in within the past month etc?

Iknow this is a pain but if someone could point me in the right direction it would be greatly appreciated.
_64k
Forum Newbie
Posts: 16
Joined: Thu Nov 12, 2009 8:52 am

Re: Change Data in Database

Post by _64k »

from my understanding of your post. You need to create a new field (last_logged_in) in the user table, it would contain a date of the last logged. In your user login script you would need to update this every time the user logs in. This field can then be used in admin script, to display for example anyone who has not logged in in the last 30 days. Simple :D
Post Reply