title: How to force an if loop to reset [PHP]
body: <p><br>
  I would like to know how to force an if loop to reset<br>
  This code is launch when a user click on a button on my index page.<br></p>
  
  <pre><code>  &lt;?php
      include 'connexionBDD.php';
      session_start();
      $commentNewCount = $_POST['commentNewCount'];
  
      $sql = "SELECT * FROM sentencesen WHERE type = 'Fun' ORDER BY rand() LIMIT 1";
      $result = mysqli_query($conn, $sql);
      if (mysqli_num_rows($result) &gt; 0) {
          while ($row = mysqli_fetch_assoc($result)) { //while 1
              $id = $row['id']; 
  
                      if(in_array($id, $_SESSION['stockID'])){ //Check if an id has been seen
                          break; //I would like this thing start the loop again
                      } else {
                          echo $row['type'];
                          echo "&lt;br&gt;";
                          echo $row['phrases'];
                          array_push($_SESSION['stockID'], $id);
                      }
          }
      } else {
          echo "There is a problem, could you refresh the page ?";
      }
  ?&gt;
  </code></pre>
  
  <p>The probleme is when the in_"array() = true" nothing appear on the screen, so i just want to have the if loop to start again and search for a content who never appear already.<br>
  Thank you everyone !</p>