Re: Deleting topics older than 2 hours?
| From: | Leif K-Brooks | Date: | Sun, 24 Nov 2002 22:05:20 +0000 |
| Subject: | Re: Deleting topics older than 2 hours? | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-23628@lists.php.net to get a copy of this message | ||
Sounds to me like you didn't understand the question. The table structure is something like:
____________topics_____________
| id | forum | author | subject | posttime |
-----------------------------
_____________posts____________
| id | topic | author | message | posttime|
-----------------------------
The problem is, if I run a query like (I know the query is probably wrong, I'm just writing it now):
delete from topics where posttime + interval 2 hours < now()
I would leave "orphan" posts inside of that topic. I'm not sure how (or if it's even possible) to delete the posts as the topic is deleted.
DL Neil wrote:
Sorry Leif, but CrystalBall v2.6 is currently unable to help. The word WHERE features. Show us the money - or second choice: the (erroneous) code... =dn-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.I'm trying to run a cron job to delete forum topics more than 2 hours old. I know how to do that, but the problem is also deleting the posts in the topic at the same time. Can someone shed some light on this,please?-- The above message is encrypted with double rot13 encoding. Anyunauthorized attempt to decrypt it will be prosecuted to the full extent of the law.-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php