I need help in getting values from database and converting them into a clickable link or url for the viewers..
Note: I bolded the part where the "link" is fetched from the database.. Thank you in advance!
Side Note: Here's my output example ()
Source Code:
<?php include 'template-parts/header.php' /** calling of header(to make it uniform in all template file) **/?>
<div class="container home" style="height:800px; opacity: 0.9; background-image:url(images/innerboard.jpg); background-repeat: no-repeat; margin-left:60px;">
<h3 style="margin-top:70px; color:white;text-shadow: 1px 6px 5px #050505;"><center>View Reference </center></h3>
<h3 style="margin-top:10px; color:white;text-shadow: 1px 6px 5px #050505;"><center>You may view your reference here </center></h3>
<?php include "connection.php" /** calling of connection.php that has the connection code **/ ?>
<table class="table table-bordered" style="margin-top:90px; width:90%; margin-left:40px;" >
<thead>
<tr style="background-color:#0E93FA;">
<th style="width:25%;"><center>Subject</center></th>
<th style="width:30%;"><center>Website Link</center></th>
<th><center>Description</center></th>
<th style="width:150px;"><center>Command</center></th>
</tr>
</thead>
<tbody>
<?php
$result = mysql_query("SELECT * FROM tbl_reference");
while($data = mysql_fetch_object($result) ):
?>
<tr style="background-color:white;">
<td><?php echo $data->subj?></a></td>
<td><?php echo $data->link?></td>
<td><?php echo $data->description?></td>
<td><center>
<a href="updatebyId**********id=<?php echo $data->id ?>">
<button class="btn btn-info"style="text-shadow: 1px 3px 5px #050505;"> Edit </button>
<a href="deleteById**********id=<?php echo $data->id ?>">
<button class="btn btn-danger" style="text-shadow: 1px 6px 5px #050505;" > Delete </button></center> </td>
</tr>
<?php
endwhile;
?>
</tbody>
<center>
<a href="createref.php">
<button class="btn btn-info" style="text-shadow: 1px 3px 5px #050505;"> Add Reference </button></center>
</table>
</div>
</div>
</body>
</html>