Skip to content
Advertisement

making clickable text from php script

I have a php script below

<?php include 'db_connector.php';
  $result = mysqli_query($con,"SELECT operation FROM contract");
   while($row = mysqli_fetch_array($result)) {
    echo $row['operation'];
    echo "<br>";
    echo "<br>";
  }
  ?> 

That produces the following output Report on AP Events

Configure & Maintain Service

Configure & Monitor SNC

Configure & Monitor Service

Report ON SNC Events

Am using it in my code as follows

<div class="description"><a id="openpanel"><?php include 'showall_contract.php';?></a></div>

I would like to know, how can I make each list item (i.e Configure & Maintain Service) as a clickable link?

Advertisement

Answer

Please echo the values inside anchor tag as

<?php

include 'db_connector.php';
$result = mysqli_query($con, "SELECT operation FROM contract");
while ($row = mysqli_fetch_array($result)) {
    echo "<a href='your url' >" . $row['operation'] . "</a>";
    echo "<br>";
    echo "<br>";
}
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement