PS: If using MySQL, you might consider just letting the SQL handle it, something like
function DeleteOldData()
{
$pdo = connectDB();
$sqlOldData = "DELETE FROM Bank_Data WHERE EntryDate < CURDATE() - INTERVAL 1 MONTH";
$return $pdo->query($sqlOldData);
}
PPS: Just return
the result, and you do not want (normally?) to exit;
from a function, as that will kill your script at that point.