hai I have login page with the help of username and password Iam entering into my login , After entering into my login I want to rename my files While entering into my login I have a field named lock in my database which is set to 1 After I signout it will SET TO 0 That's what i have done Now i need is without renaming my files iam in my login for more than 2 minutes means THE lock in the database need to be set to 0 automatically for that i need php code
To do so you will need another field in your table, let's call it: last_activity DATETIME Whenever page is loaded you should run such query: UPDATE table_name SET lock = 0 WHERE last_activity > DATE_SUB(now(), 2 MINUTES) I didn't tested it if won't work then do a search on DATEDIFF() function.