title: Stop looping of text in else statement
body: <p>I've added an if statement inside my while loop to show specific data to a specific user, but I would like to add an ELSE statement of <code>echo"No Notifications";</code>. Only it prints this text out over and over for the amount of times I've asked the loop to print results out in the SQL query. How can I stop this so it just shows the else statement the once inside the <code>&lt;div class="notif_ui"&gt;</code>div?</p>
  
  <pre><code>while($notificationchant=mysqli_fetch_assoc($chant)){
  
         if($_SESSION['id']==$notificationchant['notification_targetuser']){
              ?&gt;
              &lt;div class="notif_ui"&gt;
              &lt;div class="notif_text"&gt;
      &lt;div id="notif_actual_text-&lt;? echo $notificationchant['notification_id'] ?&gt;" class="notif_actual_text"&gt;
              &lt;?
               echo "&lt;img border=\"1\" src=\"userimages/cropped".$notificationchant['notification_triggeredby'].".jpg?photo_time=" . time()."\" onerror='this.src=\"userimages/no_profile_img.jpeg\"' width=\"40\" height=\"40\"&gt;&lt;a href='".$notificationchant['notification_throughurl']."'&gt;".$notificationchant['notification_content']." &lt;/a&gt;&lt;br /&gt;";
              echo "".Agotime($notificationchant['notification_time']).""; 
              ?&gt;
              &lt;/div&gt;
              &lt;/div&gt;
              &lt;/div&gt;
            &lt;? }}?&gt;
  </code></pre>