chekcing a database automatically
Posted: Wed Apr 15, 2009 2:39 am
hi
i'm trying to implement a phone number reservation form....
the user will enter a number and i will check if it's available or not
if the number is available the user will enter registration information to reserve this number
but the problem is this
i have a temp table which i used to store this number temporarly before completing the registeration
i put this table becouse in case another user want to register the same number he will now that this number is tmp registered and he/she can try after 15 min to check if it's fully registered or not... assume this scenario
1- the first user enters the number and he found it not registered
2- he will proceed to the registeration process
2- user two now trys to register the number
4- he will found it temporarly registered so he will wait for 15 min and check again.
5- now the first user closed the browser without completing the registeration and the number stays in he temp table
6- now any user trys to get this number will wait for infinity to get this number becouse its still in the temp table
my question is : are there anyway that can be used to trigger the database todo like minute by minute checking of the databse to do a clean up
this thing can be normally done if it's not a web application as my knowledge tell me.
do you have any suggestion?
i can do work around this by checking if the date now is larger than 15 min of the date that this number was registered in the database
but i was thinking about the capabilities of php to do such a background service
best regards
i'm trying to implement a phone number reservation form....
the user will enter a number and i will check if it's available or not
if the number is available the user will enter registration information to reserve this number
but the problem is this
i have a temp table which i used to store this number temporarly before completing the registeration
i put this table becouse in case another user want to register the same number he will now that this number is tmp registered and he/she can try after 15 min to check if it's fully registered or not... assume this scenario
1- the first user enters the number and he found it not registered
2- he will proceed to the registeration process
2- user two now trys to register the number
4- he will found it temporarly registered so he will wait for 15 min and check again.
5- now the first user closed the browser without completing the registeration and the number stays in he temp table
6- now any user trys to get this number will wait for infinity to get this number becouse its still in the temp table
my question is : are there anyway that can be used to trigger the database todo like minute by minute checking of the databse to do a clean up
this thing can be normally done if it's not a web application as my knowledge tell me.
do you have any suggestion?
i can do work around this by checking if the date now is larger than 15 min of the date that this number was registered in the database
but i was thinking about the capabilities of php to do such a background service
best regards