如何使用php创建指向表中特定列中所有行的超链接


How to make a hyperlink to all the rows in a particular column of a table using php

我希望我问得对;我是一名初级PHP程序员。这是我的代码部分。。。

$con = mysqli_connect("localhost","root","","project");
mysqli_select_db($con,"project");
$result = mysqli_query($con,"select distinct drug from drugs");
while($row = mysqli_fetch_array($result))
{
    echo "<a href='review10.php'>";
    echo $row['drug'];
    echo "</a>";
}
echo "hai";

在这里,当显示药物列表时,当用户单击任何药物名称时,应显示所有输入药物名称的客户及其用途的详细信息。我使用的是PHP/MYSQL/WAMP。

使用此代码

$con = mysqli_connect("localhost","root","","project");
mysqli_select_db($con,"project");
$result = mysqli_query($con,"select distinct drug from drugs");
while($row = mysqli_fetch_array($result))
{
    echo "<a href='review10.php'> '".$row['drug']."'</a>";
}