Re: DELETE mySQL query
| From: | Phpster | Date: | Sun, 16 Aug 2009 12:47:59 +0000 |
| Subject: | Re: DELETE mySQL query | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-46452@lists.php.net to get a copy of this message | ||
On Aug 16, 2009, at 12:23 AM, "Ron Piggott" <ron.php@actsministries.org> wrote:
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 FROMCheck out the timediff function in mysql's SQL http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_timediff Bastien Sent from my iPodguest_bookWHEREguest_book.date_submitted+ 3 hours =< '$current_time' ANDguest_book.approved= '0' LIMIT 1