Retrieve only terms that are in use

Started researching term arrays and came up with something that works, the solution for creating a conditional based on whether or not a term is in use by any post:

<?php $categories = get_categories('taxonomy=listing-neighborhood&post_type=listings'); ?>
<?php 
    $term_name = wp_list_pluck( $categories, 'name' );
    $this_name="Open House";
    if( in_array( $this_name, $term_name ) ){
        echo '<option value="">Select status or open house</option>';
    } else { 
        echo '<option value="">Select status (show all by default)</option>';
    }
?>

I appreciate everyone’s help. I think my initial question was misleading, not the question I needed to ask to find the solution.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)