当我单击链接字段时,我被困在一个想要查看 mysql 表的其他字段的地方。这是用于在链接中创建字段的代码
<td><a href="fieldview.php?id=' .$row[0]. '"><b>' .$row[1]. '</b></td>
这里 $row[0] 是 mysql table(exampletable) 中名为“id”的字段,而 $row[1] 是名为“title”的字段。现在,在“fieldview.php”页面上,我使用此代码查看其他字段:
$id=$_GET['id'];
$sql="SELECT * FROM exampletable WHERE id= '$id'";
$result=mysql_query($sql);
while ($row=mysql_fetch_array($result))
{
echo '<table id="customers">';
echo '<tr><th>Field 1</th> <th>Field 2</th> <th>Field 3</th></tr>';
echo '<tr class="alt"><td><b>' .$row[1]. '</b></td><td><b>' .$row[2]. '</b></td><td><b>Today!</b></td></tr>';
echo '</table>';
}
但是我在那个页面上什么也没有。请问谁能告诉我解决办法是什么?