Contents are not being displayed from the databse because of if else misplaced : so this is the code to in which depending on the categories suppose a user clicks on a button of the category then all the  events under that category have to be dislayed so this is what i have given as an code for that there are no errors or anything but the data is not being displayed on the page please suggest where i have gone wrong or where i have to change 
  

    <?php
        global $row2;
        if(isset($_POST['category']))
        {
                    if($_POST['category']== 'Healthcare')
                    {
                    $query = "select *from event where category = 'Healthcare';";
                    $result=mysqli_query($conn,$query)or die(mysqli_error($conn));
                     while($row2= mysqli_fetch_array($result)) 
                     {
                    ?>
            <div class="events events-full event-list">
              <div class="container">
                <div class="row">
                  <div class="col-md-9 col-sm-8"> 
                    <!--Blog Post Start-->
                    <div class="blog-post">
                      <div class="post-thumb">
                        <div class="link-wrap"> <a href="#"><i class="fa fa-search"></i></a> <a href="#"><i class="fa fa-link"></i></a> </div>
                        <img src="images/gallery/<?php echo $row2['event_image']?>" alt='user'></div>
                      <div class="event-text">
                        <div class="event-counter"></div>
                        <h4> <a href="#"><?php echo($row2['title']); ?></a> </h4>
                        <p><?php echo($row2['descrption']); ?></p>
                        <p><span class="glyphicon glyphicon-map-marker"><?php echo($row2['location']); ?></span></p>
                        <p><span class="glyphicon glyphicon-grain"><?php echo($row2['organizer']); ?></span></p>
                        <a class="nd" href="">
                          <form action="eventdetail.php" method="post">
        
        <input type='hidden' value="<?php echo $row2['id']; ?>" name='id'/>
        
                                                            
        <button type="submit" class="btn btn-primary" name="detail" value=”detail”>Event Detail</button>
                    </div>
                        </a> </div>
                    </div>
                  </form>
                   
                    <!--Blog Post End-->
          <?php } 
        }
        else if($_POST['category']== 'Finance')
                    {
                    $query = "select *from event where category = 'Finance';";
                    $result=mysqli_query($conn,$query)or die(mysqli_error($conn));
                     while($row2= mysqli_fetch_array($result)) 
                     {
                    ?>
            <div class="events events-full event-list">
              <div class="container">
                <div class="row">
                  <div class="col-md-9 col-sm-8"> 
                    <!--Blog Post Start-->
                    <div class="blog-post">
                      <div class="post-thumb">
                        <div class="link-wrap"> <a href="#"><i class="fa fa-search"></i></a> <a href="#"><i class="fa fa-link"></i></a> </div>
                        <img src="images/gallery/<?php echo $row2['event_image']?>" alt='user'></div>
                      <div class="event-text">
                        <div class="event-counter"></div>
                        <h4> <a href="#"><?php echo($row2['title']); ?></a> </h4>
                        <p><?php echo($row2['descrption']); ?></p>
                        <p><span class="glyphicon glyphicon-map-marker"><?php echo($row2['location']); ?></span></p>
                        <p><span class="glyphicon glyphicon-grain"><?php echo($row2['organizer']); ?></span></p>
                        <a class="nd" href="">
                          <form action="eventdetail.php" method="post">
        
        <input type='hidden' value="<?php echo $row2['id']; ?>" name='id'/>
        
                                                            
        <button type="submit" class="btn btn-primary" name="detail" value=”detail”>Event Detail</button>
                    </div>
                        </a> </div>
                    </div>
                  </form>
          <?php      
        } 
        } 
        }
        
         else 
                {
        
        
                      global $row2;
                    $query = "select *from event;"  ;
                    $result=mysqli_query($conn,$query)or die(mysqli_error($conn));
                     while($row2= mysqli_fetch_array($result)) 
                     {
                    ?>
            <div class="events events-full event-list">
              <div class="container">
                <div class="row">
                  <div class="col-md-9 col-sm-8"> 
                    <!--Blog Post Start-->
                    <div class="blog-post">
                      <div class="post-thumb">
                        <div class="link-wrap"> <a href="#"><i class="fa fa-search"></i></a> <a href="#"><i class="fa fa-link"></i></a> </div>
                        <img src="images/gallery/<?php echo $row2['event_image']?>" alt='user'></div>
                      <div class="event-text">
                        <div class="event-counter"></div>
                        <h4> <a href="#"><?php echo($row2['title']); ?></a> </h4>
                        <p><?php echo($row2['descrption']); ?></p>
                        <p><span class="glyphicon glyphicon-map-marker"><?php echo($row2['location']); ?></span></p>
                        <p><span class="glyphicon glyphicon-grain"><?php echo($row2['organizer']); ?></span></p>
                        <a class="nd" href="">
                          <form action="eventdetail.php" method="post">
        
        <input type='hidden' value="<?php echo $row2['id']; ?>" name='id'/>
        
                                                            
        <button type="submit" class="btn btn-primary" name="detail" value=”detail”>Event Detail</button>
                    </div>
                        </a> </div>
                    </div>
                  </form>
                   
                    <!--Blog Post End-->
                    <?php  } }  ?>