Update db.class.php, reverted function to spencers version