help with time deletion of row in sql

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
greedyisg00d
Forum Commoner
Posts: 42
Joined: Thu Feb 12, 2009 2:48 am

help with time deletion of row in sql

Post by greedyisg00d »

Hi I am currently working on a scheduler for meeting,conference etc. This is my scenario. I have 3 fields in my db(employee, date_from, date_to).

Employee: greedyisgood
Date_from: 2009-02-14
Date_to: 2009-02-15

What I want is when the date_to is already elapse or past, example today is already 2009-02-16. The entire rows with previous dates will be automatically erase in the database. So that the user can create a new schedule again.
Is it possible? Thanks in advance
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: help with time deletion of row in sql

Post by VladSun »

Yes, it's possible :)
What have you tried so far?
There are 10 types of people in this world, those who understand binary and those who don't
greedyisg00d
Forum Commoner
Posts: 42
Joined: Thu Feb 12, 2009 2:48 am

Re: help with time deletion of row in sql

Post by greedyisg00d »

Sorry I am currently new to php and mysql. Any sample codes there so that I can analyze it. Thanks
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: help with time deletion of row in sql

Post by VladSun »

Take a look at:
http://dev.mysql.com/doc/refman/5.0/en/delete.html and
http://dev.mysql.com/doc/refman/5.1/en/ ... nction_now

these are what you need to build the proper query.
Try building it and if you still have difficulties doing it, post you queries so we can help you.
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply