0

I am a newbie in PHP, here is my code to show blob image type from database to a page :

<?php
   require_once('db.php');
   $conn = connect_db();
   $sql = "SELECT * FROM product WHERE user_id = '$id_active'";
   $result = mysqli_query($conn, $sql);
   $row = mysqli_fetch_array($result);
   header("Content-type: " . $row["image_type"]);
   echo $row["photo_url"];
?>

and here is the content of the database :

enter image description here

But in the webpage, it shows nothing :

enter image description here

I want to ask if I make any mistake ? Thanks in advance

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

0 Answers0