title: Change table content using a link
body: <p>I am new to PHP and I made a simple program where you can apply your name and age, it will take the data to the database and the table will be added with a new row.
  I want to add a new column where you can click "change", only the data from that particular row will show up in a few textboxes and can be changed. when pressing submit I want to use the UPDATE function to update the records. </p>
  
  <p><strong>example/plot:</strong></p>
  
  <ul>
  <li>Mike Towards 23 Change </li>
  <li>Tyler Frankenstein 24 </li>
  <li>Change Sophie Baker 22
  Change</li>
  </ul>
  
  <p>I want to change the age of Sophie Baker to 24 so I press Change on that row.
  Now I only want to get the data from that row and make some changes.</p>
  
  <p>The code I have this far:</p>
  
  <p>Drawing the table above the input fields and the input:
      
  
  <pre><code>$result = mysqli_query($con,"SELECT * FROM Persons");
  
  echo "&lt;table border='2'&gt; &lt;tr&gt; &lt;th&gt;Voornaam&lt;/th&gt; &lt;th&gt;Achternaam&lt;/th&gt; &lt;th&gt;Leeftijd&lt;/th&gt;&lt;/tr&gt;";
  
  while($row = mysqli_fetch_array($result))
    {
    echo "&lt;tr&gt;";
    echo "&lt;td&gt;" . $row['FirstName'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['LastName'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['Age'] . "&lt;/td&gt;";
    echo "&lt;/tr&gt;";
    }
  echo "&lt;/table&gt;";
  
  mysqli_close($con);
  ?&gt;
  
  &lt;html&gt;
  &lt;body&gt;
      &lt;br /&gt;
      &lt;form action="insert.php" method="post"&gt;&lt;br /&gt;
      &lt;input type="text" name="firstname"&gt; Firstname &lt;br /&gt;
      &lt;input type="text" name="lastname"&gt; Lastname &lt;br /&gt;
      &lt;input type="text" name="age"&gt; Age
      &lt;p&gt;&lt;input type="submit"&gt;&lt;/p&gt;
      &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt; 
  </code></pre>
  
  <p>Parser:</p>
  
  <pre><code> &lt;?php
  $con = mysqli_connect("localhost", "user" , "", "personInfo");
  
  // Check connection
  if (mysqli_connect_errno())
  {
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
  
  $sql="INSERT INTO Persons (FirstName, LastName, Age) VALUES ('$_POST[firstname]','$_POST[lastname]','$_POST[age]')";
  
  if (!mysqli_query($con,$sql))
  {
      die('Error: ' . mysqli_error($con));
  }
  echo "1 record added to the database";
  echo "&lt;p&gt;&lt;a href=sql2.php&gt;Back to form&lt;/a&gt;&lt;/p&gt;";
  
  mysqli_close($con);
  
  ?&gt;
  </code></pre>
  
  <p>I have tried a few things, but I cant figure out how to show the content on the row I want to select.
  Change the actual data with the update function won't be the problem, so I only need help to get the actual data from the correct row.</p>