[英]How to make a hyperlink to all the rows in a particular column of a table using php
I hope I have asked correctly;我希望我问对了; I'm a beginning PHP programmer.我是一个初级的 PHP 程序员。 Here is my part of code...这是我的部分代码...
$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";
Here when a list of drugs are displayed, when a user clicks on any drug name, then the details of all the customers who entered the drug name and their uses should be displayed.在这里,当显示药物列表时,当用户单击任何药物名称时,应显示所有输入药物名称的客户及其用途的详细信息。 I am using PHP/MYSQL/WAMP.我正在使用 PHP/MYSQL/WAMP。
Use This Code使用此代码
$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>";
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.