> =others, eg MySQL, do not, and thus unless MySQL's last DELETE format
> option
> works sufficiently well, the best option might be two DELETE's: the
> per your suggestion above and the second to remove all entries in
> that
> no longer join to a topics row.

But you can't join on a DELETE, either (in MySQL at least). So you're
left with writing a whole PHP script to do it. Run a SELECT to get all
of the topics with IDs older than two hours. Roll up all of those IDs
into a comma separated list, like (1,2,3,4) etc. Then run two DELETE
queries on each table.

DELETE FROM topics WHERE id IN $id_string
DELETE FROM posts WHERE topic IN $id_string

Is there a better way to organize your data so this is all in one
table?? Maybe just add another column to say whether the "message" is a
topic or a post? Then your deletes could be done with single query,

---John Holmes...

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to