Upload this file as pmdelete.php and run it in your browser. Haven't tested it but it should do the trick.
PHP Code:
<?php
error_reporting ( E_ALL & ~E_NOTICE ) ;
require ( './global.php' ) ;
$_dtime = mktime ( 0, 0, 0, 12, 24, 2003 ) ;
$getpms = $DB_site->query ( "SELECT pm.pmid AS id,pmtextid AS tid
FROM " . TABLE_PREFIX . "pm
LEFT JOIN " . TABLE_PREFIX . "pmreceipt ON pmreceipt.pmid = pm.pmid
WHERE pmreceipt.sendtime <= $_dtime" ) ;
while ( $pm = $DB_site->fetch_array ( $getpms ) ) :
$_idarray[] = $pm['id'] ;
$_tidarray[] = $pm['tid'] ;
endwhile ;
$DB_site->query ( "DELETE FROM " . TABLE_PREFIX . "pm WHERE pmid IN ( '" . implode ( "', '", $_idarray ) . "' )" ) ;
$DB_site->query ( "DELETE FROM " . TABLE_PREFIX . "pmreceipt WHERE pmid IN ( '" . implode ( "', '", $_idarray ) . "' )" ) ;
$DB_site->query ( "DELETE FROM " . TABLE_PREFIX . "pmtext WHERE pmtextid IN ( '" . implode ( "', '", $_tidarray ) . "' )" ) ;
echo "<p><font face=\"courier\">PM Deletion Completed.</font></p>" ;
?>
Cheers,
g-force2k2