简体   繁体   中英

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. 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.

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>";
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM