Hello to all reading this thread. I want to ask you a question about mysql records and more specifically deleting them. I have a database which has a table called orders. In orders I have fields: ID, Name, Date created, Date expire. My question is, how can an order be deleted at the "Date expire" ? I want the MySQL do it itself, so I would not be required to login and delete it mysqlf. Thanks for the time and hopefully I'll get it :) Good day all!

Recommended Answers

All 6 Replies

You need to schedule that using Event Scheduler.

Create a procedure to delete the desired records and schedule the same.

please read more here and here.

Plz write some code and find out the problem.

commented: don't post mindless stuff -3

debasisdas has posted good link
@Anuradha Mandal - atleast try to put some effort to read it ...

you can post problem, if you are getting any to write this scheduling or anything else (although this thread has not started by you)....

commented: Do not understand????? +0

Although debasisdas has pointed you in the correct direction, if you are on a shared web host, chances are you cannot turn on the scheduler. In that case you may be able to use a cron job.

commented: agree +13
commented: What are you saying? +0

I can not understand what are you want to explain? Plz tell me the detail "pratik_garg,

commented: out is the way to go. -3

If the links from debasisdas can't help you, search for "cron job".

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.