i want to clear all data in databse automatically for everymonth.iam using xampp.

Recommended Answers

All 6 Replies

Add a timestamp in every table and use that to determine whether or not it should be deleted.

sorry....will you please write one example query

It's not that simple.

  1. Add a timestamp column to the tables you want to do this for.
  2. Make sure that when you insert a new record this date gets filled.
  3. Create a query to run at regular intervals to remove all records with old dates.

thnk you.

thank you so much
i have finishd 1st & 2nd step.
but strugling in 3rd step (i,e Create a query to run at regular intervals to remove all records with old dates.).bcoz i dont no hoew to write a query tat automaticaly execute

Be a part of the DaniWeb community

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