title: How to get row ID in button click?
body: <p>I have a table that I fill with records from the database. What I want to do when the view button is clicked is to be able to get the ID of the row so that I can call on the other information of the user but I'm not quite sure how to do it. Here's how I filled the table.</p>
  <pre><code> &lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot; width=&quot;600&quot;&gt;
  &lt;tr&gt;
      &lt;th&gt;ID&lt;/th&gt;
      &lt;th&gt;Username&lt;/th&gt;
      &lt;th&gt;Email&lt;/th&gt;
      &lt;th&gt;Telephone&lt;/th&gt;
      &lt;th&gt;Date Registered&lt;/th&gt;
      &lt;th&gt;Member Details&lt;/th&gt;
  &lt;/tr&gt;
  
   &lt;?php
  require('db_connection.php');
  $query=&quot;SELECT ID,Username,Email,Telephone,RegisterDate FROM Members&quot;;
  $result=mysql_query($query) or die(mysql_error());
  
  while($row=mysql_fetch_array($result))
  {
      echo &quot;&lt;/td&gt;&lt;td&gt;&quot;;
      echo $row['ID'];
      echo &quot;&lt;/td&gt;&lt;td&gt;&quot;;
      echo $row['Username'];
      echo &quot;&lt;/td&gt;&lt;td&gt;&quot;;
      echo $row['Email'];
      echo &quot;&lt;/td&gt;&lt;td&gt;&quot;;
      echo $row['Telephone'];
      echo &quot;&lt;/td&gt;&lt;td&gt;&quot;;
      echo $row['RegisterDate'];
      echo &quot;&lt;/td&gt;&lt;td&gt;&quot;;
      print '&lt;center&gt;&lt;input name=&quot;ViewBtn&quot; type=&quot;submit&quot; value=&quot;View&quot; /&gt;&lt;/center&gt;';
      echo &quot;&lt;/td&gt;&lt;/tr&gt;&quot;;
  }
  ?&gt;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/naNFP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/naNFP.png" alt="image" /></a></p>