title: How to display each row data in the database?
body: <p>I'm having a hard time displaying the title and note on each row of my database. I want to display one row (with the title and note) after each
  from a form in a page heading to the displaying of row datas page.</p>
  
  <p>This is my code below:</p>
  
  <p>//
  Let's say that we have 4 rows of datas. In my code, I can only display the first row, because it keeps having the first row's data. This is because the form is in the first php file. Then after I submit the form, it's directed to this file, and it keeps getting the first row.</p>
  
  <pre><code>&lt;?php $con=mysqli_connect("localhost","root","","task");?&gt;
  &lt;?php $results = mysqli_query($con, "SELECT * FROM note"); ?&gt;
  &lt;?php while ($row = mysqli_fetch_array($results)) { ?&gt;
  
  &lt;?php
  $id=$row['id'];
   echo '&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;';
      echo '&lt;button class="call_modal" data-id="$id" style="cursor:pointer;"&gt;'. $row['title'] . '&lt;/button&gt;';
  ?&gt;
  &lt;?php
  }?&gt;
  &lt;?php $results = mysqli_query($con, "SELECT * FROM note"); ?&gt;
  &lt;?php while ($row = mysqli_fetch_array($results)) { ?&gt;
  &lt;div class="note" data-id="&lt;?= $row['id'] ?&gt;"&gt;
  &lt;div class="modal"&gt;
  &lt;div class="modal_close close"&gt;&lt;/div&gt;
  &lt;div class="modal_main"&gt;
  
  &lt;?php
     echo '&lt;br&gt;&lt;br&gt;';
  
         echo '&lt;div class="padding"&gt;'.$row['title'].'';
          echo '&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;';
      echo ''.$row['note'].'&lt;/div&gt;';
  ?&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;?php
  }?&gt;
  &lt;?php
  &lt;?php
  function test_input($data) { 
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    return $data;
  } ?&gt;
  </code></pre>