I'm new to PHP and have been working on a generic php based search engine in order to search through a MYSQL database. I've stored pictures of buildings on google drive at in goo.gl format. My question is how would I go about creating a hyperlink for the url listed within the database because the links will differ in most cases when being pulled from the database. Either having a clickable link or showing the picture would be great.
<html>
<head>
<title> Buildings</title>
</head>
<center>
<body>
<?php
include "connection.php";
$sql = "SELECT * FROM Building_Loc ";
if (isset($_POST['search'])) {
$search_term = mysql_real_escape_string($_POST['search_box']);
$sql .= "WHERE Building LIKE '%{$search_term}%' ";
$sql .= "OR Floor LIKE '%{$search_term}%' ";
$sql .= "OR Number LIKE '%{$search_term}%' ";
$sql .= "OR Building_Pictures LIKE '%{$search_term}%' ";
}
$query = mysql_query($sql) or die(mysql_error());
?>
<form name="search_form" method="POST" action="display_data.php">
Search: <input type="text" name="search_box" value="" />
<input type="submit" name="search" value="Search">
</form>
<table width="80%" cell padding="60" cellspace="60">
<tr>
<td><strong>Building</strong></td>
<td><strong>Floor</strong></td>
<td><strong>Number</strong></td>
<td><strong>Picture</strong></td>
</tr>
<?php while ($row = mysql_fetch_array($query)) { ?>
<tr>
<td><?php echo $row['Building']; ?></td>
<td><?php echo $row['Floor']; ?></td>
<td><?php echo $row['Number']; ?></td>
<td><?php echo $row['Building_Pictures']; ?></td>
</tr>
<?php } ?>
</body>
</center>
</html>