Update db_fns.php

generalized db hook