Jump to content

PHP Form Auto-Empty Script


vigiw

Recommended Posts

Hello,

I have a working PHP form that sends data to my MySQL database.  It is used for a weather alert system.  One of the fields in the form & database is an expiration field.  It shows the user when the alert will expire.  Is there a way to auto-delete just the data sent with that form when it is supposed to expire?  I have many weather alerts and I would like them to be emptied from the database when it is needed.

Please help, this is a much needed feature.  All help appreciated :)

Thank you so much!
Link to comment
Share on other sites

No, I don't want to delete tables.  I was just verifying that it only empties the data that I want it to, and not deleting.

I have a weather forecast system, it officially launched to the public last night.  I have different forecast areas and different alert types and so they are in their own tables of one database.  It is already working, the hard part is over.  I just want the old data to be removed.

I have another question:

What format does the expiretime have to be in?

Date, Time, maybe, I don't know the exact format to make the database understand.

Thanks.
Link to comment
Share on other sites

Ok Thanks..


Is there a way to make this script automatic?  Maybe cron jobs?

I honestly do not know what a cron job is and have never used one so I would not know what to do.

It seems very tedious running this every so often since there will be quite the amount of alerts to empty when needed.
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.