Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP中的href重定向到更多信息_Php_Html_While Loop - Fatal编程技术网

PHP中的href重定向到更多信息

PHP中的href重定向到更多信息,php,html,while-loop,Php,Html,While Loop,我现在在我的产品旁边有一个链接,该链接会将用户带到一个页面,该页面包含存储在数据库中的关于手头产品的更多信息。 我不想有不同的链接,所以产品本身就是链接 这是我在链接位于产品旁边时的代码。 while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>".$row['Name']."</td>"; ?> <td><a href="lis

我现在在我的产品旁边有一个链接,该链接会将用户带到一个页面,该页面包含存储在数据库中的关于手头产品的更多信息。 我不想有不同的链接,所以产品本身就是链接

这是我在链接位于产品旁边时的代码。

while($row = mysql_fetch_array($result))
{
    echo "<tr>";
    echo "<td>".$row['Name']."</td>";
    ?>
    <td><a href="list_item.php?id=<?php echo $row['Band_id'] ?>">view Information</a></td>
    <?php 
    echo "</td>";
}   
while($row=mysql\u fetch\u array($result))
{
回声“;
回显“$row['Name']”;
?>
替换:

<td><a href="list_item.php?id=<?php echo $row['Band_id'] ?>">view Information</a></td>

与:


好,因此您需要删除查看信息并将php回音放在那里,如:

while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td><a href='list_item.php?id=".$row['Band_id'].">".$row['Name']."</a></td>";
}
while($row=mysql\u fetch\u array($result))
{
回声“;
回声“;
}
试试这个。

你可以这样做:

while($row = mysql_fetch_array($result))
{
    ?>
    <tr>
        <td>
            <a href="list_item.php?id=<?php echo $row['Band_id']; ?>"><?php echo $row['Name']; ?></a>
        </td>
    </tr>
    <?php
}

其中“Killer”是指向信息页面的实际链接。

你有什么错误?我不确定我能猜出你的问题是什么。也许可以尝试重新措辞或更详细地解释一下?很多人都在我的问题中添加了更多内容来更好地解释。问题是,我尝试了这个,它只是将代码显示为字符串,而不是name.Brilliant,工作得很好。谢谢你,原来我在正确的道路上,但我错过了?php当我尝试它。谢谢你。
while($row = mysql_fetch_array($result))
{
    ?>
    <tr>
        <td>
            <a href="list_item.php?id=<?php echo $row['Band_id']; ?>"><?php echo $row['Name']; ?></a>
        </td>
    </tr>
    <?php
}
+-------------+
|  Band Name  |
+-------------+
|  Killer     |
+-------------+