I want to show blob image from mysql but show just only one image, i want to show all image in agrid view, but how ?


$con = mysqli_connect('localhost', 'root', '', 'blog');
if (mysqli_connect_errno()){

echo mysqli_error($con);


$sql = "SELECT image FROM images ORDER BY id DESC";

if (!$result=mysqli_query($con, $sql)){

echo mysqli_error($con);

else {
$row = mysqli_fetch_array($result);
//header('Content-type: image/jpeg, image/png, image/jpg');
//echo $row["image"];
echo '<img src="data:image/jpeg;base64,'.base64_encode($row['image'] ).'" height="auto" width="100"/>';

//echo '<img src="view1.php?id=' . $row['id'] . '">';



Add Comment

  • 0 Answer(s)

  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.