我正在使用php将查询结果回显到像这样的表
echo '<table border="1">';
echo '<tr>';
echo ' <th bgcolor="#FFFFFF" >Team Name </th>';
echo ' <th bgcolor="#FFFFFF" >Player Name </th>';
echo ' <th bgcolor="#FFFFFF">Jersey Number </th>';
echo '</tr>';
while ($Row = mssql_fetch_assoc($result))
{
echo '<tr><td>' . $Row['Team Name'] . '</td><td>' . $Row['Player Name'] . '</td><td>' . $Row['Jersey Number'] . '</td></tr>';
}
echo '</table>';
};
我希望Jersey Number
是一个超链接,它可以读取Player Name
的值并将其传递给php文件以用作查询参数,并在页面加载时为该特定播放器提取数据
示例数据类似于
Team Name --- Player Name --- Jersey Number
Red Bob Jones 12
Blue Jack Horner 14
因此,如果您单击14,代码将读取Jack Horner并将其存储在变量中。如何用php / html实现这个目标?
修改
这样的事情就是我所追求的...使用一个页面重定向并传入player name
以用作参数。
简要说明,将超链接设置为名为other.php的页面,并将QueryString
.$row['name']
的值作为echo "<td><a href='other.php?playername=".$row['Player Name']'>" . $row['Player Name'] . "</a></td>";
的一部分传递
我尝试了以下语法,但它给了我一个500错误
ActionExecutedContext