我正在用PHP编码刷新我的记忆,我是一个真正的新手。我想做的是将PHP驱动的表中的结果链接到唯一的网页(基于唯一的ID)。我知道将.php?id添加到URL代码中有一些好处。我陷入困境的地方是如何在表格上返回链接。这是我所拥有的:
if($result = mysqli_query($link, $sql)){
if(mysqli_num_rows($result) > 0){
echo "<table>";
echo "<tr>";
echo "<th>Atlantic Division</th>";
echo "<th>Nickname</th>";
echo "<th>Wins</th>";
echo "<th>Losses</th>";
echo "<th>Points</th>";
echo "</tr>";
while($row = mysqli_fetch_array($result)){
echo "<tr>";
echo "<td>" . $row['Name'] . "</td>";
echo "<td>" . $row['Nickname'] . "</td>";
echo "<td>" . $row['Wins'] . "</td>";
echo "<td>" . $row['Losses'] . "</td>";
echo "<td>" . $row['Points'] . "</td>";
echo "</tr>";
}
echo "</table>";
// Close result set
我的主要问题是如何在此行中插入链接:
echo "<td>" . $row['Name'] . "</td>";
谢谢!