Identifying each table row using SQl
<p>I have created a table using HTML that retrieves data from my database. At the end of each row, I have manually added a submit button which is inside the while loop as the data is retireved from the database. Once the button is clicked, the session username is inserted into a table in the database. I also want it to enter other data of only the specific row. With what I have right now, no matter which button you click on any row, the data from the first row is only inserted.</p>

<p>Thanks for all your help.</p>

<p>In simpler words, on button click how do I select the data from that row where the button is present and insert it into the db?</p>

<pre><code>mysql_select_db("my_db", $con);

$result = mysql_query("SELECT * FROM Persons");

echo "&lt;table border='1'&gt;
&lt;tr&gt;
&lt;th&gt;Firstname&lt;/th&gt;
&lt;th&gt;Lastname&lt;/th&gt;
&lt;/tr&gt;";

while($row = mysql_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;"; include "button.php"; echo "&lt;/td&gt;";
      echo "&lt;/tr&gt;";
      }
    echo "&lt;/table&gt;";
</code></pre>

<p>Button.php checks for the session_username and adds it to the database. I want it to also insert the "firstname" .</p>
