Jump to content

Image print help in Php


s4salman

Recommended Posts

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:

https://xyz.com/po/row[5]

Can any body help me how i can do this. I tried different code but could not succeed.

 

<?php
$con=mysqli_connect("localhost","****","****","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)\n",$row[0],$row[5]);
    }
  // Free result set
  mysqli_free_result($result);
}

mysqli_close($con);
?>

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.