RE: [PHP-DB] Delete by date?

2002-12-08 Thread John W. Holmes
> How would I do that? I just did this: > > $date = date("Y-m-d"); > > and changed my date field in my MySQL DB to use the Date format, I don't > know if that's correct though? Then how would I get to delete all before > the current date? DELETE FROM table WHERE date_column < CURDATE() ---Joh

Re: [PHP-DB] Delete by date?

2002-12-08 Thread Chris Payne
Sorry, ignore the last message it's working now :-) Thanks for your help though John, got me looking in the right direction. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Delete by date?

2002-12-08 Thread Chris Payne
Hi there, How would I do that? I just did this: $date = date("Y-m-d"); and changed my date field in my MySQL DB to use the Date format, I don't know if that's correct though? Then how would I get to delete all before the current date? Sorry to be a pain, date stuff really throws me :-( Chris

RE: [PHP-DB] Delete by date?

2002-12-08 Thread John W. Holmes
> I use the following to store the current date in my db: > > $date = date("mdY"); > > then to decrease the day by -1 I use the following: > > $date = date("Y"); > $date2 = date("m"); > $date3 = date("d")-1; > > $dateb = '$date$date2$date3'; > > Now what I need to do, is when a DB operation i