Thanks, Jacqueline.
I've been soliciting some help over at
TAZ as well and member Sarah there has suggested this:
Quote:
I would use your script to keep the pmreceipt synchronized also.
SELECT COUNT( * )
FROM vbpmreceipt
LEFT JOIN vbpm ON vbpm.pmid = vbpmreceipt.pmid
LEFT JOIN vbpmtext ON vbpm.pmtextid = vbpmtext.pmtextid
WHERE vbpmtext.dateline < $time
These selects are actually trickier than the deletes because they are selecting COUNT(*). You can do the deletes all with one query.
DELETE *
FROM vbpmtext, vbpm, vbpmreceipt
WHERE (vbpm.pmid = vbpmreceipt.pmid)
AND (vbpm.pmtextid = vbpmtext.pmtextid)
AND vbpmtext.dateline < $time
Test on a backup first!
|
I'm a little too tired to try this tonight but I will when I am more awake (the "print" version first!).