Delete by date?

From: Date: Mon, 09 Dec 2002 02:47:59 +0000
Subject: Delete by date?
Groups: php.db 
Request: Send a blank email to php-db+get-23911@lists.php.net to get a copy of this message
Hi there everyone, 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 is run it checks the DB to see if there are any dates that match $dateb or less (Yesterday or before) and then delete those only, leaving todays in the DB, I tried the following with no success: mysql_query ("DELETE FROM orderstemp WHERE < '$dateb' "); This query works if I do a delete by id, but not how i'm doing it here, does anyone have any ideas? Be gentle with me, dates are newish to me :-) Thanks. Chris

« previous php.db (#23911) next »