Jump to content

Deleting old database entires


spikypunker

Recommended Posts

Hey guys

 

Just wanna get some thoughts on how to approach a small problem. I've developed a section on my website where i can enter gigs in an entry from and they get displayed on 5 different pages, (5 different cities) When you enter the gig or event you have to enter a date for it, this is in the standard mysql date format yyyy-mm-dd. I then display the listings in date ascending order etc. Is there a way of building a routine that deletes from the mysql db, any entires older than the current date? Either that or make it not pull entries from the db that are older than the current date. IE can the DATE fromat of a mysql db be compared to the TIME function in php?

 

Here is the code for pulling the entries, very simple:

 

$query = "SELECT * FROM events WHERE town='colchester' ORDER BY date ASC";

Link to comment
https://forums.phpfreaks.com/topic/146686-deleting-old-database-entires/
Share on other sites

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.