Jump to content

Delete DB entry after a given date (php/mysql) help


dannybrazil

Recommended Posts

Hello

Im looking for help with this chalenge:

I have  a database with "future events" in it.

 

each even is given a DATE(example: Aug' 25 - film festival)

 

and a user will see all of the future event ONLY

 

WHAT i need here id a code the i can run every day (i can run it no problems) and it will DELETE old entries from the DB.

 

lets say today is Aug'  12 so i want to delete ALL entries with a date OF Aug 11 and back

 

Any help ?

 

Danny

Another question

 

lets say i have 20 entries from today on

 

i want to present JUST the 4 that are the closest to today ?

 

today is 18/08/2009

 

i have entries from sep 1 on...( 1..2..3..4..6..8..15...23....29)

 

but there ARE not order as i wrote here they are mixed

 

is there any way to SQL by distance from current date ?(lets say 1 week in advanced)

 

thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.