what I need to do in my website is to show a list of jpg images stored in a Mysql database using Blob type (I don't want to use any other way). but instead of the image I got strings like this
����$ExifMM*bj(1r2��i��SI'SI'Adobe Photoshop CS6 (Windows)2014:07:31 20:02:56�����&(."�HH����XICC_PROFILEHLinomntrRGB XYZ � 1acspMSFTIEC sRGB���-HP cprtP3desc�lwtpt�bkptrXYZgXYZ,bXYZ@dmndTpdmdd��vuedL�view�$lumi�meas$tech0rTRC<�gTRC<�bTRC<�textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ �Q�XYZ XYZ o�8��XYZ b����XYZ $����descIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view��_.���\�XYZ L.....
This is the code...
<?php
// Create connection
$con=mysqli_connect("erossenses@localhost","erossenses","-----","my_erossenses");
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM Racconti");
echo "<br>";
echo "<font style=\"font-family:Verdana; font-size:15px; color:maroon\"><b><u>Titolo</u></b></font>";
echo "<br>";
echo "<br>";
header('Content-type: image/jpeg');
while($row = mysqli_fetch_array($result)) {
echo $row['Immagine'];
echo "<br>";
}
mysqli_close($con);
?>
Where am I wrong?
", also only echo one jpeg image instead of multiple – Anders Lindén Jul 13 '15 at 15:33