使用 DB 中的循环显示所有图像。这是我的代码。图像以咬合格式保存到数据库。无法使用循环检索和显示所有图像。例如 img1、img2、img3 等...有人知道我可能做错了什么吗?
$username = "root";
$password = "123";
$host = "localhost";
$database = "test";
@mysql_connect($host, $username, $password) or die("Can not connect to database: ".mysql_error());
@mysql_select_db($database) or die("Can not select the database: ".mysql_error());
$query = mysql_query("SELECT * FROM tbl_images");
while($row = mysql_fetch_array($query))
{
header('Content-type: image/jpg');
$content = $row['image'];
echo $content;
}