Any chance it's the time value you used? Or the possibility that you have no PM receipts?
I really need to create a test forum, I think...
But I'm also wondering about just omitting the PM receipts in the main query and adding a line to delete ALL of the receipts, which are far from critical.
That would give us:
Code:
<?php
require ("global.php");
$time = time() - (27 * 24 * 60 * 60);
$a = $db->query("DELETE vbpmtext . * , vbpm . * FROM vbpmtext, vbpm WHERE (vbpm.pmtextid = vbpmtext.pmtextid) AND vbpmtext.dateline < $time");
?>
and then we just add a DELETE * or TRUNCATE query for vbpmreceipt to follow.