I have an application there we can take mock tests, when the user starts the exam in database the column called testStarted will be set to 1 and when the user ends the test the value of column will set back to 0 , i have done this because single user should not take more than one test at same time…
Now when user starts the test and he will not end it so that the value in the database will be 1 and he cant take test any more… so what i need is when the test time is completed the value should set back to 0 this should happen in server not in local machine how to do this????
PLEASE HELP ME…
You should look into cronjobs. Cronjobs can execute commands that do things at specific times or periodical. The best way to do this is to create a php script that changes the column back to 0 after lets say 100 minutes.
A cronjob that runs every minute can verify what tests have been started 100 minutes ago and set the column to 0.
You can find more info about the cronjobs here http://www.adminschoice.com/crontab-quick-reference
Ask your hosting company how to set up cronjobs for your server.
To run a cronjob you can use
or something like
Depending on what you have available on your server