How to decrease a database field by 1 when user logs on????
Posted: Sun Jul 23, 2006 3:03 pm
I have a database with the fields username, password and sessions. Each user has a certain amount of sessions and I have setup my site to display how many sessions that user has left when he logs in.
How do I get it so that when he logs in, the sessions field under his id gets decreased by 1, so then his amount of sessions will be 1 less when he views it on the next page?
This would need like an update record function that occurs at the same time when the user clicks login, only if the login details are correct though.
What code would I need to do this? Any ideas? Thanks in advance.
How do I get it so that when he logs in, the sessions field under his id gets decreased by 1, so then his amount of sessions will be 1 less when he views it on the next page?
This would need like an update record function that occurs at the same time when the user clicks login, only if the login details are correct though.
What code would I need to do this? Any ideas? Thanks in advance.