I have a table in the database where it contains image,name,location. I tried to display the name and location, both got displayed. But i struck at how to display the image in the table td. I have almost 4 to 5 rows in the table .
Below is the code which I used.
HTML:
<?php
echo "<table border='1'>";
echo "<tr><th>Hotel</th><th>Location</th></tr>";
$i=1;
$html="";
foreach($one as $id => $key):
$html .= "<tr>";
$html .= "<td>".$one[$id]."</td>";
$html .= "<td>".$two[$id]."</td>";
$html .= "<td>".$three[id]."</td>";
$html .= "</tr>";
endforeach;
$html .= "</table>";
echo $html;
?>
PHP:
<?php
session_start();
$link = mysqli_connect('localhost','root','','hotels');
if(isset($_POST['sub']))
{
// mysqli_s(elect_db($link, "hotels");
$location=$_POST['searchVal'];
$sql = "select * from rooms where location = '$location'";
$sqldata= mysqli_query($link ,$sql);
while($row = mysqli_fetch_array($sqldata)){
$one[] = $row['name'];
$two[] = $row['location'];
$three[] =$row['Image'];
}
?>
Output. I am getting some symbols like this:
Can anyone please help me out to solve this displaying of image into table.