Jump to content

clean up database after user leaves app


eddierosenthal

Recommended Posts

i have an application that has several pages of forms and data entry is recorded in the mysql db.

if the user finishes, ie; goes thru all the pages and finishes, the php hander for the form does its calculations / reports and emails and removes the data in the database.

There is ajax involved, in that as the data is entered in the php handler is called for mysql data recording.

If user does not finish the form, or does not go thru to the finish, what sort of solution is available for cleaning up

the database?

I would like to be able to call the php hander if the user closes the window ( on any of the pages) to clean up.

I could add a cancel button but prefer to either prompt for finishing or cleanup.

Do i have to create some sort of cron job to clean up the db, or is there a way to do it directly?

 

Link to comment
Share on other sites

that doesn't appear to me like a very logical way to approach the thing.

If i clean up after an hour with a cron job and a different user is entering data i would certainly mess up their session.

I think what i really need is the primary key  and the process id passed to a forked  or exec'ed

process, which performs the operation after it is notified / figures out that the process is dead or

zombied, or at least get the primary key or session id to the cron job.

I know how to pass variables to a function, how do i pass arguments to a standalone php file?

is there a argv[] in php?

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.