DELETE mySQL query
| From: | Ron Piggott | Date: | Sun, 16 Aug 2009 04:21:49 +0000 |
| Subject: | DELETE mySQL query | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-46450@lists.php.net to get a copy of this message | ||
Is there a way to do the math in a DELETE statement (All 1 step; See my "sample" below
pseudo code below). I am trying to delete the record if it is more than 3 hours old and the value
of "approved" is still 0.
DELETE FROM
guest_book WHERE guest_book.date_submitted + 3
hours =< '$current_time' AND guest_book.approved =
'0' LIMIT 1