我有一张表格,里面填满了数据库中的记录。单击视图按钮时我想要做的是能够获取行的 ID,以便我可以调用用户的其他信息,但我不太确定该怎么做。这是我填满表格的方式。
<table border="1" cellpadding="5" cellspacing="2" width="600">
<tr>
<th>ID</th>
<th>Username</th>
<th>Email</th>
<th>Telephone</th>
<th>Date Registered</th>
<th>Member Details</th>
</tr>
<?php
require('db_connection.php');
$query="SELECT ID,Username,Email,Telephone,RegisterDate FROM Members";
$result=mysql_query($query) or die(mysql_error());
while($row=mysql_fetch_array($result))
{
echo "</td><td>";
echo $row['ID'];
echo "</td><td>";
echo $row['Username'];
echo "</td><td>";
echo $row['Email'];
echo "</td><td>";
echo $row['Telephone'];
echo "</td><td>";
echo $row['RegisterDate'];
echo "</td><td>";
print '<center><input name="ViewBtn" type="submit" value="View" /></center>';
echo "</td></tr>";
}
?>