new function to get the dbname from any url