Its a shame this was taken out, but i guess once its cleared down it works well...
So heres the code..
$query = "
SELECT COUNT(*) FROM {$config['tbprefix']}Messages
WHERE M_Sent <= $purge
";
$sth = $dbh -> do_query($query);
list($deleted) = $dbh ->fetch_array($sth);
if ($deleted < 1) { $deleted = 0; }
$query = "
DELETE FROM {$config['tbprefix']}Messages
WHERE M_Sent <= $purge
";
$dbh -> do_query($query);
So if I wanted to delete a load of messages older than 90 days what would the syntax be?
Whos the SQL experts

thank you