db.php functionality