Page 1 of 1

help with time deletion of row in sql

Posted: Mon Feb 16, 2009 12:42 am
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

Re: help with time deletion of row in sql

Posted: Mon Feb 16, 2009 3:37 am
by VladSun
Yes, it's possible :)
What have you tried so far?

Re: help with time deletion of row in sql

Posted: Mon Feb 16, 2009 7:25 am
by greedyisg00d
Sorry I am currently new to php and mysql. Any sample codes there so that I can analyze it. Thanks

Re: help with time deletion of row in sql

Posted: Mon Feb 16, 2009 3:42 pm
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.