title: how to stop do-while looping and fixing the button function?
body: <p>I want to make it stop looping, but I dont know what's wrong. I want it to be like..
  Clicking the button then shows the text, and keep repeating like that in one page.</p>
  
  <p>I have the code tht goes like this:</p>
  
  <pre><code>&lt;?php
      include "koneksi.php";
      $query = mysqli_query($connection,"SELECT * FROM buatsoal_db ORDER BY ID DESC");
      $id = mysqli_query($connection, "select 'ID' from buatsoal_db");
      ?&gt;
  
  &lt;?php
      do{ ?&gt;
          &lt;form method= 'post'&gt;
          &lt;input name='next' type='submit' id='next' value='next'&gt;
          &lt;/form&gt;
              &lt;?php if(isset($_POST['next'])){ ?&gt;
                      &lt;table width="637" border="0" cellspacing="1" cellpadding="2"&gt;
                      &lt;tr&gt;
                          &lt;th width="297" scope="col"&gt;
                              &lt;?php $row = mysqli_fetch_array ($query);
                               echo $row['SOALTXT']; ?&gt;
                      &lt;/tr&gt;
                      &lt;/table&gt;
              &lt;?php } 
              ?&gt;
  &lt;?php   }
  
      while ($id = 'S01');
      echo "sudah selesai";
  ?&gt;
  </code></pre>
  
  <p>I dont know what's wrong, it keeps looping like this :
  <a href="https://i.stack.imgur.com/uVht3.jpg" rel="nofollow noreferrer">first_executes_looping non stops</a>
  and the button next shows up all together, and when I clicked it, the txt shows up at the same time too. I want it to shows up one by one, and keeep it repeat until the id="s01"from the txt is over.</p>