这就是我的表在我的数据库中的样子。我正在尝试显示我存储的图像,它是 mimetype (longblob) 。当我运行代码时,它给了我一个带有 ? ,没有错误只是那个框。有谁知道错误是什么以及我该如何解决?
Display
+-------+------------+----------+
| Index | Display_ID | Picture |
+-------+------------+----------+
| 1 | 12 | longblob |
+-------+------------+----------+
<?php
$mysqli=mysqli_connect('localhost','root','','draftdb');
if (!$mysqli)
die("Can't connect to MySQL: ".mysqli_connect_error());
$imageid= 12;
$stmt = $mysqli->prepare("SELECT PICTURE FROM display WHERE DISPLAY_ID=$imageid");
$stmt->bind_param("i", $imageid);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($image);
$stmt->fetch();
header("Content-Type: image/jpeg");
echo $image;
?>