This is my actual code, i'm starting to using php and i want to know how to display a blob image on my website. But until now i can't find how to do it. This is my php code...
$query=mysqli_query($link, "SELECT image, titulo, tecnica, medidas FROM upload ");
$numrows = mysqli_num_rows($query);
$posts = array();
if ($numrows != 0)
{
while ($row = mysqli_fetch_assoc($query))
{
$post = new stdClass();
$post->image = '<img src="data:image/jpeg;base64,'.base64_encode($row['image']).'"/>';
$post->titulo = $row['titulo'];
$post->tecnica = $row['tecnica'];
$post->medidas = $row['medidas'];
array_push($posts, $post);
}
}
$jsonData = json_encode($posts);
header("Content-Type: image/jpeg");
echo $jsonData;