I want to print image in the following Php code along with the name of the image. I want to print name in first row of the html table, while full image in the 2nd row. row[5] contain image file name such as abc.jpg. I want to print whole image url like this in second row:
Can any body help me how i can do this. I tried different code but could not succeed.
<?php
$con=mysqli_connect("localhost","s4salman_user","salmanreadskalakaka","s4salman_color");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$url = $_GET['url'];
$sql="SELECT * FROM coloringpages where url = '$url' ORDER BY id";
if ($result=mysqli_query($con,$sql))
{
// Fetch one and one row
while ($row=mysqli_fetch_row($result))
{
printf ("%s (%s)
",$row[0],$row[5]);
}
// Free result set
mysqli_free_result($result);
}
mysqli_close($con);
?>
Insert following line after printf ("%s (%s) ",$row[0],$row[5]);
echo '<img src="https://example.com/po/'.$row[5].'">';