Php image is not working using phpmyadmin

Hello,

I have an issue, I want to retrieve images stored in phpmyadmin, but when I test it. It looks like that

my code is :

 <?php
//show information
ini_set('display_errors',1);
error_reporting(E_ALL);

include "connect.php";


$q = "SELECT * FROM animaldata";
$r = mysqli_query($conn,$q);
if($r)
{
while($row=mysqli_fetch_array($r))
{
//header("Content-type: text/html");
echo "</br>";
echo $row['aname'];
echo "</br>";
echo $row['adetails'];
echo "</br>";

//$type = "Content-type: ".$row['aphototype'];
//header($type);
echo "<img src=image.php?ano=".$row['ano']." width=300 height=100/>";


}
}
else
{
echo mysql_error();
}
?>

anyone can help, I would be very grateful. and thank you

Firstly, you should use echo 'imagename" please note that the quotes inside the are single quotes, and by the look of it, you have ended “image.php?ano=”.$row[‘ano’]." with nothing at the end of the period mark

Try this:

echo '<img src="image.php?ano="'   .$row['ano']   .'" width="300" height="100" alt="' .$row['aname']   .'" />';

I tried it but now I’m getting the name of the image only ,like that

What is your “image.php” source folder? Clearly getting the wrong folder, that is the problem

Thanks for your answers, I was missing base64_encode and a name typo, now it works.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.