Define specific category name in PHP

I would advise against query_posts for readability purposes as its easier to make mistakes and you can end up muddled when you nest them. ( You also missed out an equals sign in your syntax.

Instead use WP_Query, and check for when no posts are found, e.g. this code:

<div class="category-section">
    <h2><?php the_category(); ?></h2>
    <div class="content">
        <?php
        $q = new WP_Query('category_name=theCategoryName');
        if($q->have_posts()){
            while ($q->have_posts()) : $q->the_post(); ?>
                #code...
            endwhile;
        } else {
            ?><p>No posts</p><?php
        }
 ?>
    </div>
</div>

Finally, the root cause of you’re problem, you must add a call to this function after you’re done with your loop to reset everything back to before the loop.

If you’re using WP_Query or get_posts call wp_reset_postdata();

If you’re using query_posts use wp_reset_query();

Remember to reset things after every post loop, always check if there are any posts before starting the loop, and always put the reset after the check, not inside after the loop ( else it won’t reset if no posts are found).