convert to db_select, correct logic in vsite_access.install #3660

#3660