?
Solved

SQL/PHP Query to delete records listed before today's date.

Posted on 2007-10-15
1
Medium Priority
?
1,763 Views
Last Modified: 2013-12-13
Hi,

I currently have a VERY simple database storing fixtures from our PE department.  At the moment I have a page that allows people to add events, and another page that allows the to search for and delete events.  What I'm after is a page, or even an automatic script that deletes events after they have happened so that they're not still listed weeks and weeks afterwards.
0
Comment
Question by:llantwit
1 Comment
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 20076776
in MySQL, the query to run would be this:

delete from yourtable where date_col < current_date()
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses
Course of the Month15 days, 7 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question